BlockLocker 1.3.4

Protect chests, doors, etc. using signs. UUID compatible.

  1. rutgerkok
    Tested Minecraft Versions:
    • 1.12
    Source Code:
    https://github.com/rutgerkok/blocklocker
    This plugin allows you to protect chests, doors, furnaces, dispensers, droppers, hoppers and many other blocks to be protected using signs. Once a sign is attached, only people listed on the sign can access the container. It uses no databases, all information is stored on sign attached to the protected block.

    The plugin can be used as a replacement for Lockette, existing protections will carry over fine and will be converted to use UUIDs when someone interacts with them. Don't worry: lookups are cached, never on the server thread (so your server doesn't pause while it's waiting for Mojang.com), never for online players and support outdated player names.


    Features

    [​IMG]

    • Protect chest, doors, etc. simply by attaching a sign.
    • Doesn't need a database, the plugin just looks for attached signs.
    • Allow other players to access your protection.
    • Allow groups to access your protection.
      • Groups are defined using permission nodes, scoreboard teams, Towny towns, Towny nations or MassiveCraft Factions
    • UUID support
      • Stores UUIDs on signs in a hidden text component, so UUIDs are saved between server restarts.
      • Automatically updates protections without UUIDs when someone interacts with them.
      • Lookups are never on the server thread, so your server doesn't pause while it's waiting on mojang.com.
    • Supports double doors and double chests (double trapped chests too).
    • Shows a message to players placing a chest, so that they know chests can be protected.
    • Automatically closes doors when a [Timer:X] tag is added , or when a default door close time has been specified in the config file.
    • Redstone support
      • Redstone cannot open protected doors, unless a [Redstone] tag is added.
      • Hoppers (minecart hoppers too!) cannot take or put items, unless a [Redstone] tag is added.
      • Compatible with existing Lockette/Deadbolt protections
    • Auto-updater
      • Server owners get notified when there is a BlockLocker update available.
      • The auto-updater works asynchronously, it will never block the server.
      • The auto-updater used to be able to download and install JAR files from spigotmc.org (it is restricted to spigotmc.org only). The code for this is still in the plugin. However, the plugin isn't able to contact spigotmc.org anymore, probably because of a DDOS protection measure. As a result, the auto-updater can only notify you of updates, but you have to download them yourself.
      • The auto-updater can of course be toggled off.
    • Configuration
      • Specify exactly which blocks and doors can be protected.
      • Add extra doors and blocks, for example TNT or note blocks.
      • All messages can be translated.
      • Reload config files while the server is running using /blocklocker reload

    Usage

    [​IMG]

    Placing signs
    For containers (chests, furnaces, dispensers, etc.) it's easy: just place a sign against the block. BlockLocker will automatically add [Private] to the first line and your name to the second.

    You can also place a sign while sneaking, this allows you to add some text to the third and fourth lines. You can leave the second line empty, your name will be placed here.

    For doors, place a sign with [Private] on the first line against the block above the door. Placing a sign on the block below the door, or on the door, works too, but looks less nice.

    Trapdoors can be protected by placing a sign with [Private] on the first line against the block the trapdoor is attached to.

    Editing signs
    Right-click the sign and type /blocklocker <line number> <text> to replace the text on the given line. You can shorten this to /bl <line number> <text>.

    Adding people to the sign
    On the third and fourth row of the sign with [Private] you can add the names of up to two friends who may also access the chest. Want to add more people? Place a second sign against the chest. BlockLocker will add [More Users] to the first line and [Everyone] to the second line. If you want to change this, right-click the sign to edit it.

    If the name of the person you're adding doesn't fit on the sign, just type as many characters as possible. If the person you're adding is currently online, BlockLocker will be able to complete the name.

    If no Minecraft account exists with the name, a ~ is added before the name. However, the ~ is not added for things that don't look like an username, so --text-- won't be changed to ~--text--. This should still give you plenty of options to decorate the sign, while it will still be obvious when name is not a valid Minecraft name.

    Special tags

    [​IMG]

    The tag [Everyone] grants everyone access to the protection. The tag [Redstone] grants hoppers access to the container, and allows redstone signal to open doors.

    [​IMG]

    There's also a [Timer:X] tag, where X is a number from 0 to 9. Doors (trapdoors too) will close automatically after the specified amount of seconds. Use 0 to never close the door automatically. The timer tag overrides the default close timer setting the config.yml.

    You can also add [MyGroup], which will grant all members of the group MyGroup access to the chest. See "Group support" below for what groups are supported.

    Finally, you can also add +MyGroup+, which grants mayors and assistants of a Towny town or nation access.

    Setup

    Permissions
    There's a very simple permission structure for now:

    • blocklocker.protect - create new protections
    • blocklocker.bypass - bypass all protections, edit all protections
    • blocklocker.reload - use /bl reload to reload the configuration files
    • blocklocker.group.groupName - adds you to the group with the name groupName, so that you have access to protections with a [groupName] tag on it.

    Commands
    • /blocklocker <line number> <text> - places the specified text on the last sign you selected (right-clicked). You can only select signs on your own protections, unless you have the permission node blocklocker.bypass.
    • /blocklocker reload - reloads configuration files. Requires the permission node blocklocker.reload

    Configuration
    You can change what block types can be protected, you can set a default close timer for doors and you can set whether one sign protects a whole row of containers, or only the current container.

    The file plugins/BlockLocker/config.yml contains explanations of all settings, I won't repeat them here. Just open the file!

    There's also a translation file, you can edit all user-visible text here, as well as changing the [Private], [More Users], etc. tags to something else.

    When you have made a change, run the command /bl reload for your settings to take effect. You can of course also restart the server.

    Group support

    [​IMG]

    When placing [MyGroup] on a sign, every member of MyGroup will have access to the protection. The plugin considers the following persons to be a member of the group MyGroup:

    • People with the permission node blocklocker.group.mygroup. The permission node is always blocklocker.group. with the lowercase group name appended to it.
    • People in the scoreboard team MyGroup (case insensitive). You can modify scoreboard teams using the (vanilla) command /scoreboard.
    • When MassiveCraft Factions is installed: people in the faction called MyGroup (case insensitive).
    • When Towny is installed: people in a town or nation called MyGroup (case insensitive).

    When placing +MyGroup+ on the sign, only mayors and assitants of Towny towns and nations called MyGroup will have access.

    Other group systems are currently not supported. If you want support for another plugin, just ask me.

    Automatic updater
    For a plugin designed to protect you, it is important that any security fixes can be pushed out quickly. That's why the plugin includes an auto-updater as of version 1.0.

    The updater is restricted to downloading files only from spigotmc.org. It will only download files marked as compatible with your Minecraft version. It will also only install files marked as suitable for automatic updating.

    The updater works asynchronously: it will never pause your server while it's downloading something. Update files are placed in plugins/update so that the file will automatically replace the old file on the next server startup.

    If you want to disable the updater, or if you want to restrict it to only notify for updates (but never download them) you must edit the plugins/BlockLocker/config.yml file. Set the updater setting in the file to DISABLED or JUST_NOTIFY. If you don't see the update setting in the file it is because you have a pre-1.0 config file. Simply add updater: DISABLED or updater: JUST_NOTIFY to a new line and you'll be fine.

    UUID support
    BlockLocker has been built with UUID support in mind. Minecraft 1.8 allows signs to use chat components. BlockLocker adds a hidden chat component with UUID information.

    When your server is running in offline mode, not behind a BungeeCord proxy, the plugin won't use UUIDs and will continue to use names.

    When UUIDs are used, the plugin accesses api.mojang.com every now and then to look up UUIDs of offline players added to a sign.

    Bugs

    I have tested this plugin for a while now on my server, I think it's now ready for use in production. As of version 1.0 the plugin includes an auto-updater, so that any exploits can be patched quickly.

    There's a bug in vanilla Minecraft: it doesn't convert signs properly from 1.7 to 1.8. Signs with [Private] on it are "converted" to Private, destroying the protection. This is not a bug in BlockLocker, if you use Lockette/Deadbolt/etc. you'll experience the same issue. If you haven't loaded up your world in 1.8 yet, add -DconvertLegacySigns=true to the startup script, after java but before -jar. If you have already updated, you can use a little program I wrote to fix those signs. It will try to fix all converted signs and it will correctly convert all unconverted signs. (It goes without saying, but make a backup of your world first. The program worked fine for my world, but no idea if it will work for you too.)

    If you have found a bug, please report it! You can report it here in in the forum thread, or on Github. Please provide instructions for me how I can reproduce the bug.

    Any questions?

    Can you add this feature?
    Just ask in the forum thread. :)

    I won't add features that require a database. Example: limiting the amount of protections you can create, this requires setting up a database that counts the amount of protections of each player.

    How do I change the color scheme of messages, [Private] and [More Users]?
    Open plugins/BlockLocker/translations-en.yml (if you're using another language, open up that file instead) and add/remove color codes.

    Is Minecraft 1.7 (or older) supported?
    No. Those versions cannot store text components on signs, so the hidden UUID text component cannot be stored. Result: the plugin won't function.

    Hoppers cannot put items into/take items from chests. How can I fix this?
    Add a line with the text [Redstone] or [Everyone] to the sign.

    What are the differences between this plugin and Lockette?
    This plugin uses no code from Lockette. It was written from scratch. I have listed the major ones here, but there are many more smaller differences.

    Lockette has no real UUID support: it just looks up your old names. (UUIDs are cached as Bukkit metadata, but not saved, so they are lost when the server restarts.) BlockLocker uses hidden text components, which means that the data will carry over to other Minecraft servers (like Sponge, if BlockLocker gets ported to Sponge) and that external editors like MCEdit won't delete the UUID data.

    Lockette has only rudimentary redstone support. You have to add [Everyone] to your door for redstone to work. In BlockLocker [Everyone] still works, but you can also add a [Redstone] tag instead.

    Hoppers are not well supported in Lockette: either they never take items from protected containers, or always, depending on a configuration setting. BlockLocker allows you to add a [Redstone] tag to allow hoppers. When no [Redstone] (or [Everyone]) tag is added, hoppers won't be able to place or take items from the container.

    Placing signs works a little different. In both plugins you can attach a sign to a container simply by right-clicking the container with a sign in your hand. The sign will be filled with [Private] on the first line and your name on the second line.
    In Lockette you can also place a sign next to a container. You have to manually type [Private] on the first line. Lockette will then move the sign so that it is attached to the chest. I find this behaviour not very useful, so it is not included in BlockLocker. For those cases where you want to add something to the third or fourth line of the sign, you can either edit the sign after placing it, or you can place the sign while sneaking, allowing you manually edit the sign.

    Lockette currently has hooks for many plugins (McMMO, SimpleClans, etc.) for group support, BlockLocker currently only has hooks for vanilla scoreboard teams, permission nodes, Towny towns, Towny nations and MassiveCraft Factions.

    I have another question.
    Please ask! The best place is here in the forum thread. You can also send me a PM, but keep in mind that others won't be able to benefit from any solution you found.

Recent Updates

  1. BlockLocker 1.3.4
  2. BlockLocker 1.3.3
  3. BlockLocker 1.3.2

Recent Reviews

  1. MrStende
    MrStende
    5/5,
    Version: 1.3.4
    So happy that i found this lockette alternative since lockette is getting outdated
  2. MeltedTuberYT
    MeltedTuberYT
    5/5,
    Version: 1.3.4
    Works great on our server.

    One suggestion:
    Instead of signs use a command instead like /lock then do /trust and /untrust to add people to open the chest.
    1. rutgerkok
      Author's Response
      Thanks!

      The problem with adding commands is that I need some place to store who's the owner of the chest. Now that information is stored on the sign, which has the advantage that no external database is needed. This means that you can freely move chests using WorldEdit (or McEdit) without the chest getting unlocked.

      If you're looking for a plugin that does use commands (and therefore an external database), see LWC. I'm not going to rework this plugin to use a database, that would require too much effort. Besides, supporting both signs and databases would make the plugin too complex.
  3. pinkpig
    pinkpig
    5/5,
    Version: 1.3.3
    I use the plugin on my 1.10.2 server and it works like a charm. I'm not sure which version I use for that server so whatever it says I'm reviewing is not accurate. Planning to update my server to 1.12 which is why I'm downloading the latest version now.
    Definitely recommend this plugin to anyone that doesn't allow raiding on their servers! :)
  4. Betob89
    Betob89
    2/5,
    Version: 1.3.2
    [00:34:58] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to BlockLocker v1.3.2
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[survival.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[survival.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [survival.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [survival.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:228) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.PlayerInteractManager.interact(PlayerInteractManager.java:463) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:759) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:52) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [survival.jar:git-Spigot-db6de12-18fbb24]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131]
    at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [survival.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [survival.jar:git-Spigot-db6de12-18fbb24]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
    Caused by: java.lang.NoSuchMethodError: org.bukkit.event.player.PlayerInteractEvent.getHand()Lorg/bukkit/inventory/EquipmentSlot;
    at nl.rutgerkok.blocklocker.impl.event.InteractListener.onPlayerInteract(InteractListener.java:258) ~[?:?]
    at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[survival.jar:git-Spigot-db6de12-18fbb24]

    FIX PLEASE
    1. rutgerkok
      Author's Response
      Oh come on. This plugin is for Minecraft 1.11. You're using Minecraft 1.8, which is almost three years old.
  5. AzartoxHD
    AzartoxHD
    4/5,
    Version: 1.3.1
    It's a good plugin, very similar to other plugins But very useful for survival or other servers. You should also do it in other languages.
  6. groovybluedog
    groovybluedog
    4/5,
    Version: 1.2.0
    Please consider adding functionality (if enabled) to place signs anywhere - like underneath the door, or to the side of the door. Also please could you remove the thing that stops me putting signs above doors? I normally have my protection signs on the inside above the doors (as other locations are disallowed) however I cannot place a non-protection sign on the outside wall of above the door without an error, something I can do in other protection plugins.

    Still, great work, especially with the self fixing doors and [Redstone] functionality!
  7. niqoar
    niqoar
    5/5,
    Version: 1.2.0
    A great plugin that does its job very well, with a developer attentive a the users and their ideas.
  8. andris155
    andris155
    4/5,
    Version: 1.1.2
    Please add option change [private] line on sign, and add more words pl.: [Lock], private etc...
    1. rutgerkok
      Author's Response
      You can change the [Private] label in the translation file. Keep in mind however that this will invalidate all existing protections.

      Also, I would like to remind you that this is a review area, and your comment is not really a review. Please use the discussion thread for feature requests :)
  9. Fro
    Fro
    5/5,
    Version: 1.1.1
    It works for me and nice for someone traveling looking for stuff... thx!
  10. MeMyself
    MeMyself
    5/5,
    Version: 1.1.1
    Very nice!