Skip to content

Prevent items being taken from creative to survival#53

Open
RoboMWM wants to merge 3 commits intoSpigotMC:masterfrom
RoboMWM:add-mycmd-again
Open

Prevent items being taken from creative to survival#53
RoboMWM wants to merge 3 commits intoSpigotMC:masterfrom
RoboMWM:add-mycmd-again

Conversation

@RoboMWM
Copy link
Contributor

@RoboMWM RoboMWM commented Nov 14, 2015

Basically PR #52 without conflicts with permissions.yml

We need a way to segregate inventories, and any forms of it at the moment use NMS. What I propose here is similar to what I implement on my server - clears player inventory when transferring to/from creative and survival worlds.

Alternatively, we could restrict teleportation to a certain area in which we clear the player's inventory beforehand.

@md-5
Copy link
Member

md-5 commented Nov 14, 2015

Sure plotsquared / multiverse has an official endorsed way of doing this without resulting to a custom command wrapper?

@RoboMWM
Copy link
Contributor Author

RoboMWM commented Nov 14, 2015

For clearing items on world warp? Not to my knowledge. Would be interested to know if there is. The other way to go about this is to use some sort of plugin that listens to playerworldchange events and clear (depending on world origin & destination), although I'm not aware of such a plugin.

MV expects Multiverse-Inventories, PlotSquared doesn't care.

@HeroCC
Copy link
Contributor

HeroCC commented Nov 18, 2015

We can use MultiInv, it is more updated then multiverse-inv and we wouldn't need to use MyCommand

@RoboMWM
Copy link
Contributor Author

RoboMWM commented Nov 18, 2015

@HeroCC MultiInv uses TuxTwoLib which uses NMS, so no, that's not going to work. (Btw, Multiverse-Inventories is in fact being updated more than MultiInv as of now.)

@Jikoo
Copy link

Jikoo commented Nov 24, 2015

If you're interested in full-on separation, I've got InventorySeparator, an API-only flatfile inventory separation plugin I wrote when Multiverse-Inventories got too buggy for my taste. I never bothered finishing it because I swapped to MultiInv, but if it'd be a good solution to this problem I'd be willing to go back to it and get it into a release-ready state.

Currently I think the basic features work (I'm not actually sure - the commit I pushed today was a bunch of changes mostly made a year ago), but it's still easy to abuse creative to escape fall and fire damage, heal up, get a ton of exp, or get free potion effects. Easy enough stuff, but when I found an existing alternative to MV I didn't see a point in bothering.

It also won't support items stored in the offhand slot unless that's part of the armor contents. That, I can't really do anything about.

@RoboMWM
Copy link
Contributor Author

RoboMWM commented Nov 24, 2015

Potions and exp are blocked in Creative, and I'm not sure how one would transfer to and from creative (this suggests via command) - if so, could use warmups/cooldowns (probably even just Essentials warmups/cooldowns). Only issue seems to be that offhand slot.

@Jikoo
Copy link

Jikoo commented Nov 24, 2015

Re: Experience/potions: Dispensers. Pop a ton of stuff in and set a clock, away you go.

How is transferring done currently? Sorry, I've never actually been on the Spigot snapshot server myself, I mostly just stumbled on the repo and noticed this issue.

If you want a plugin and commands to handle it, my plugin, with some tweaks, could be the best shot, as I'm pretty sure the alternatives all go off the API somewhere or other.

After a bit of thought, I propose you handle this using vanilla mechanics in a similar fashion to the concept of this PR instead.
Have some sort of enclosed area in the spawn where players enter, knowing due to clear signage, that they cannot transfer items.
When a button/pressure plate in the room is pressed, command blocks run /clear @a[r=10] and /mvtp @a[r=10] creative (obviously, better target selectors could be written, I'm just lazy)
Simple and clean - anyone within the room is cleaned up and teleported. It'd have a very vanilla feel - no user commands, just in-world interaction, and it would be (relatively) swiftly accessible from spawn.
You'd need to make sure that per-world permissions are set up so that users can't /home into or out of creative, instead having to use the transfer structure at spawn. Overall it'd be a lot lighter weight than adding another plugin to the mix and wouldn't add the balancing act of commands that might need a warmup or additional checking beforehand.

@RoboMWM
Copy link
Contributor Author

RoboMWM commented Nov 24, 2015

All container access is blocked, and they can't even put the item into their inventory. (WorldGuard blocks this.) Item drops are prevented via PlotSquared (iirc) and hoppers are also blocked. (WorldGuard is also blocking this). It might be possible for a malicious client to spawn in a pre-filled dispenser - which we could also prevent with WorldGuard (I might do a PR to add that as well).

@Jikoo
Copy link

Jikoo commented Nov 25, 2015

Gotcha. Wish there were post ratings here so I wouldn't need to post a useless reply to acknowledge that it's already handled.

Any rate, like I said, I think command blocks executing your idea at a fixed location is the best plan, with my plugin being a poor second.

I guess it comes down to whether an op can take some time ingame to set it up or if the team would rather just accept a pull and restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants