Keys - LWC-like container/block protection

Keys locks down personal items like chests, furnaces, brewing stands, doors, etc.

Features

  • Auto-locks lockable items on placement.
  • Configurable list of “lockable” blocks.
  • Commands to lock or unlock blocks manually.
  • Add or remove keys for others to your blocks.
  • Configurable storage engine (only H2 support currently)

Commands

  • /lock - Run command and punch a block to lock it.
  • /unlock - Run command and punch a block to unlock it.
  • /keys add (user) Run command and punch a block to grant another player access.
  • /keys del (user) Run command and punch a block to revoke another player’s access.

Permissions

  • keys.use - Use the plugin.
  • keys.mod - Override locks. For staff purposes only.

Get Help

IRC: irc.esper.net #prism

12 Likes

Yeah ! Finally a LWC like plugin :slight_smile:

A plugin, that could have a very good reputation soon ^^

Very happy to see that too! :slight_smile: I’ll test it now! :slight_smile:

viveleroi, could you add something to private double chest ?

Like if someone tape /lock (or /unlock) on a chest, the plugin look at the fourth faces If another chest exists and use the command on it too.

Edit : I did test with a player. If we don’t lock the two chests of a double chest, other players can open a chest with the non-protected block.

Edit 2 : If we place a hopper or a minecrat Hopper under a chest, it give the possibility to override locks.

Sponge doesn’t yet have an event for hoppers interacting with inventories, so we have to wait for that before I can catch those.

I’ll add an issue for the double-chest/command bug. Good catch.

2 Likes

awesome but can you add a notification when you interact with the block it says you have locked this chest etc. and if you open someone elses chest op and above it will say whos chest it is?

Thanks
Flash4203

1 Like

I believe this might be an issue

String dbPath = Keys.getParentDirectory().getAbsolutePath().toString() + “/keys”

see [Closed] Server Error: Hikaripool problem?

I would try this instead

String dbPath = Keys.getParentDirectory().getAbsolutePath().toString() + File.separator + “keys”

I could be wrong though…who knows, I’m insane

File.separator is only for the gui :stuck_out_tongue:. Really awkward, but I figured that out yesterday (@FerusGrim XD).

Interesting. Well I learned something today.

Either way, the thread referenced there’s an issue with the plugin. Maybe someone can help them out.

I removed Keys like they suggested and it fixed the problem, any suggestions on how to add it back properly?

Nice plugin. I would add a command that would allow you to list all the players who have keys to the block you punch so that you can see the list as the owner of that block.

Hello, I am having an issue where players are unable to unlock their blocks if they want to move them. They have the keys.use permission node, and they can access their locked blocks, just not break them.

Is anyone else having this issue or is it just me as it usually is lol

No one else has reported that issue, what does it say when they try to remove the block?

Yea I am having the same problem as Jesse. :frowning:

If you can find steps to reproduce, please file an issue with more information like Sponge version, etc.

I figured out what is happening. The Pixelmon mod is fighting Keys for the unlock command, I need to figure out how to set up an alias for them to use just for Keys or redirect the Pixelmon command.

@JesseWayne21

You use the commands/aliases feature in the global.conf (server/config/sponge/global.conf)
In the config you will see “commands” Its 3rd from the top. Where it says “aliases” put the following in the “swiggly brackets”

unlock=Keys

So it should look like this:
http://paste.ubuntu.com/15155515/

Then restart then you’re done! When you do /unlock it will run this mod’s unlock command. If you still need to use the Pixelmon’s unlock command just do /pixelmon:unlock <name>

2 Likes

I saw you put a protection to deny players to break blocks under protected chests but if there is an air case under or next to, they can put an hopper to empty protected chests.

Can you add a full protection to deny placement of blocks ?

Hoppers will be handled on their own, but Sponge has not yet added the proper events for us to block that interaction. Outside of that type of interaction and other chests, we don’t need to prevent placement.

I hope can protect the paint and frame

1 Like