[MECH/ADMN] ButtonLock v1.3.4 - Locking able Buttons and Levers for Minecraft [2520]

Discussion in 'Inactive/Unsupported Plugins' started by MrX13415, Jun 24, 2011.

  1. Offline

    MrX13415

    [​IMG]

    Please visit BukkitDev:

    This Thread is deprecated ...
    You can download the newest Version here too
    but for more infos, error reports and help please go to BukkitDev
    ----------------------------------------------------------------------------------------------------
    ButtonLock - Locking able Buttons and Levers for Minecraft
    Version: 0.9 r42

    Remake of Shanduros usefull 'CodeLock'
    • All Blocks are lockable (see config, exept pistons)
    • You need the right passwod to use a locked block
    • Locked blocks arent removeable
    • Permission support
    • iConomy support
    • Single-use-passwords
    • By-Pass
    • Only Enter the password once at login ...
    [​IMG]Download (github)
    older Versions: 0.8 ; 0.7.3 ; 0.7.2 ; 0.7.1 ; 0.7 ; 0.6.1 ; 0.6 ; 0.5 ; 0.4 ; 0.3

    Download Source (github)

    Use:
    Click at a Button or place a new Button or Lever.
    Use the '/setpw' (see 'command-list') command to set a Password.

    Click at the Button or Lever ...

    Enter the required Password in the Chat (just lik it is ... or use the command /pw, 'see command-list')
    You have by default only 10 seconds to enter the password...

    If it was successfull, press the button or lever again to use it or chage the state ...
    Also you can use the '/setpw' command to change or remove the password from the button or lever.
    (only works if the right password was entered ...)

    Note: you must unlock the Block first to before you can make any changes ...

    How it Protects a Door
    How it Protects a Door (open)

    Here is an example how a door will be protected:
    [​IMG]

    Command-list (open)

    Command-list:
    • /setpassword <password>, /setpw <password> - Set/change a Password
    • /setpassword, /setpw - Remove a Password
    • /password <password>, /pw <password> - Enter a Password
    • /singelUsePassword add <password1> [<pw2> ...], /supw a <password1> [<pw2> ...] - Add a single-use-password
    • /singelUsePassword remove <password1> [<pw2> ...], /supw r <password1> [<pw2> ...] - Remove a single-use-password
    • /ButtonLock <save|reload|reset>, /bl <s|rl|reset> - Save/reload all configs or reset ButtonLock
    • /ButtonLock group forcePassword <true|false> - enforces a password every time or not ...
    • /ButtonLock group costs <costs> - change the costs of a locked group ...
    • /ButtonLock group <add|remove> - adds or removes a Block to or from a locked group ...

    Permission nodes (open)

    Code:
    # need to use ButtonLock and the command /password
    ButtonLock.use
    Code:
    # need to set passwords
    ButtonLock.setpw
    Code:
    # need to use the '/SingleUsePassword' command
    ButtonLock.singleusecods
    Code:
    # need to by-pass all passwords (must be enabled in the config)
    ButtonLock.bypass
    Code:
    # need to by-pass iconomy (must be enabled in the config)
    ButtonLock.iconomy.bypass

    Config file (open)

    Config file:
    Code:
    UseChatforPasswordInput: true
    EnablePasswordByPass: false
    ForcePasswordEveryTimeByDefault: false
    # in milliseconds (1000 = 1 sec)
    TimeforEnteringPassword: 10000
    
    UsePermsissions: true
    IfNoPermissionsOPOnly: false
    
    # IConomy
    UseIConomy: true
    EnableIConomyByPass: false
    Costs: 0.5
    
    LockableBlocksList:
      - STONE_BUTTON
      - LEVER
      - CHEST
      - WOODEN_DOOR
      - IRON_DOOR_BLOCK
      - TRAP_DOOR
      - SIGN_POST
      - WALL_SIGN
      - STONE_PLATE
      - WOOD_PLATE
    
    
      
    UseChatforPasswordInput:
    You can choose between the normal Password input with a Command (see 'comannd-list') or the command-less input in the chat (but only type in the password after click once at the button or Block ... ;) )

    EnablePasswordByPass:
    Enable the password by-pass permission

    ForcePasswordEveryTimeByDefault:
    If true you must enter the password every time, otherwise only once at login ...

    TimeforEnteringPassword:
    Time to enter the password before time out ... (in millis)

    UsePermsissions:
    Enables Permission support

    IfNoPermissionsOPOnly:
    If true only OPs can use the Plugin ... (commands allways OP only, exept /PW)

    UseIConomy: - Enables iConomy support

    EnableIConomyByPass:
    Enable the IConomy by-pass permission

    Costs:
    Hown many should it cost to use a button for example successfull (only subtract money if you enter the password correctly)

    LockableBlocksList:
    conntains the list of the Lockable Blocks, in that Case: Stone buttons, Levers, Chests, and Wooden doors (see 'Block-List')

    Block-List (open)

    Block-List:
    Code:
    AIR
    STONE
    GRASS
    DIRT
    COBBLESTONE
    WOOD
    BEDROCK
    WATER
    STATIONARY_WATER
    LAVA
    STATIONARY_LAVA
    SAND
    GRAVEL
    GOLD_ORE
    IRON_ORE
    COAL_ORE
    LOG
    LEAVES
    SPONGE
    GLASS
    LAPIS_ORE
    LAPIS_BLOCK
    DISPENSER
    SANDSTONE
    NOTE_BLOCK
    BED_BLOCK
    POWERED_RAIL
    DETECTOR_RAIL
    WEB
    LONG_GRASS
    DEAD_BUSH
    WOOL
    YELLOW_FLOWER
    RED_ROSE
    BROWN_MUSHROOM
    RED_MUSHROOM
    GOLD_BLOCK
    IRON_BLOCK
    DOUBLE_STEP
    STEP
    BRICK
    TNT
    BOOKSHELF
    MOSSY_COBBLESTONE
    OBSIDIAN
    TORCH
    FIRE
    MOB_SPAWNER
    WOOD_STAIRS
    CHEST
    REDSTONE_WIRE
    DIAMOND_ORE
    DIAMOND_BLOCK
    WORKBENCH
    CROPS
    SOIL
    FURNACE
    BURNING_FURNACE
    SIGN_POST
    WALL_SIGN
    WOODEN_DOOR
    LADDER
    RAILS
    COBBLESTONE_STAIRS
    LEVER
    STONE_PLATE
    IRON_DOOR_BLOCK
    WOOD_PLATE
    REDSTONE_ORE
    GLOWING_REDSTONE_ORE
    REDSTONE_TORCH_OFF
    REDSTONE_TORCH_ON
    STONE_BUTTON
    SNOW
    ICE
    SNOW_BLOCK
    CACTUS
    CLAY
    SUGAR_CANE_BLOCK
    JUKEBOX
    FENCE
    PUMPKIN
    NETHERRACK
    SOUL_SAND
    GLOWSTONE
    PORTAL
    JACK_O_LANTERN
    CAKE_BLOCK
    DIODE_BLOCK_OFF
    DIODE_BLOCK_ON
    LOCKED_CHEST
    PAINTING
    MINECART
    CLAY_BRICK
    CAKE
    BED
    I hope, I don't forgot any Block or something else ... :)


    ToDo:
    • add an option to create userdefinated groups
    • (keep it up to date ;) )
    Changelog:
    Version: 0.8.1
    • FIX: Protectable Blocks are add able to a group now too
    • FIX: Groups are locked now after using the commands '/bl group add/remove/forcePW/costs'
    Version: 0.8
    • ADD: Password by-pass
    • ADD: IConomy by-pass
    • ADD: Settings to enable/disable by-pass
    • ADD: You only need to enter the password once after login
    • ADD: Command to change the cost of a group
    • ADD: Command to add/remove blocks from a group
    • ADD: Command to enforce a password every time from a group
    • FIX: Protectable-Blocks list getting longer and longer sometimes
    Changelog (open)


    Changelog:
    Version: 0.7.3
    • FIX: Locked-groups-config issue (again :( )
    Version: 0.7.2
    • FIX: locked-groups-config bug: sometimes there were empty groups
    Version: 0.7.1
    • FIX: Permissions bug
    • FIX: NullPopinterExeption
    • ADD: OPOnly - Setting in the config
    Version: 0.7
    • ADD: Command to reload/save/reset ButtonLock
    Version: 0.6.1
    • FIX: Locked-groups-config-file get cleared bug
    Version: 0.6
    • ADD: Singele-use-Passwords
    • FIX: Use '/pw <password>' and than click at a block to unlock it.
    • ADD: Entering password time out (see Config)
    Version: 0.5
    • ADD: Permission Support
    • ADD: IConomy Support
    • ADD: More options in the config
    • FIX: Locked blocks save-file-format changed
    • FIX: Better block protection
    • FIX: Password bug
    • FIX: Double-blocks (like doors) are full lockable too
    Version: 0.4
    • ADD: Config file
    • ADD: Split save file into one file for each world.
    • FIX: Passwords are saved as hash, not as clear text now
    • FIX: The Block under a Locked Block is now non breakable if locked.
    • ADD: It is Configabel which Block is Lockable and which not.
    Version: 0.3
    • ADD: Save file
    Version: 0.2
    • ADD: Locking able Buttons
    • ADD: Locking able Levers
    • ADD: Colored Chat
    Version: 0.1
    • init Version


    Credits:

    Thanks to everyone who are useing my Plugin !

    Special thanks to:
     
    Triforce9 likes this.
  2. Offline

    MrX13415

    I update it to 0.4
    :D
     
  3. Offline

    kahlilnc

    This is nice, LWC doesnt protect these and bypasses those too so this is good. Thanks
     
  4. Offline

    MrX13415

    thx :)
     
  5. Offline

    turtleerc

    Its nice but if someone puts in a wrong password it says it was denied but you can use the button/lever
     
  6. Offline

    MrX13415

    Sure ?
    On my Server it works correctly: The event is canceled if the Password wasn't correct
    check it like this:
    Place a block and attach a button/lever on it and at the top a redstonetorch...
    The redstone torch should change its state, if the password was correctly entered only ... otherwise not.

    If the password was wrong, and you press the button for example, it will look like the button is still working, but there is no reaction ...
     
  7. Offline

    Dexo

    This looks good but could you add LWC-like protection, having a password as an option but allowing for the users to lock it so only he/she can open it like LWC does.
     
  8. Offline

    MrX13415

    I think about that :)
     
  9. Offline

    flendten

    uhm is it possible to make it work with iconomy? so you can adjust the money people have to spend, each time pressing the button? or lever ofc, but im searching for a plugin that does that with a button
     
  10. Offline

    MrX13415

    Is possible yes :)
     
  11. Offline

    flendten

    would you do that for me? :D i really need that on my server ;)
     
  12. Offline

    MrX13415

    ok, will do it for you :)
    I try to implement it in the next version ...
     
    flendten likes this.
  13. Offline

    Sh00ck

    That whould be good yes ;D
     
  14. Offline

    flendten

    ok thank you so much! sry for not asking, ive been on holiday :S ;D
     
  15. Offline

    Triforce9

    This plugin is exactly what I've been looking for! Thank you! :D

    Though, I'm having the same problem as turtleerc:
    After looking at the Source through GitHub, I think I might have found the culprit:
    PasswordCommandExecuter.java
    Now, I don't know Java, but I do know programming languages similar to Java, and it seems to me like the code in the linked file checks if the player has entered a password, and on line 28, unlocks the block regardless of the validity of the password. I would edit the file myself and test it on my server, but I'm worried about breaking something important!
     
  16. Offline

    MrX13415

    The Syntax of Java is like C++ or C just other API.
    mhm ... maybe i have fix this bug in the current dev build but not in the version here on bukkit ...
    I hope version 0.5 is reday soon ... try to finish it :)

    just edit it and try it ... if you break something only this plugin doesnot work ...
    you cant break something importenet ;)

    And about the bug ...
    Code:
    package de.MrX13415.ButtonLock;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    
    /**
    * Handler for the 'PassordCommand' command.
    * @author MrX13415
    */
    public class PasswordCommandExecuter implements CommandExecutor{
    
        @Override
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
    
                PlayerVars tmpVars = ButtonLock.getPlayerVars(player);
    
                if (tmpVars != null) {
                    if (args.length == 1){
                        String tmpPassword = args[0];
    
                        if (tmpVars.isEnteringCode()) {
                            player.sendMessage(Language.TEXT_CODE + Language.getMaskedText(tmpPassword));
                            LockedBlockGroup.checkPassword(tmpVars, tmpPassword.hashCode());
                            tmpVars.getCurrentClickedLockedButton().setUnlock(true);
                            tmpVars.setEnteringCode(false);
                            return true;
                        }
                    }
                }
            }
            return false;
        }
    
    }
    Just remove line 28 or add "//" at the beginning of the line ;)
    Code:
      tmpVars.getCurrentClickedLockedButton().setUnlock(true);
    Will be fixed in the next Version ...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  17. Offline

    Triforce9

    Alright, I'll give it a shot! ;)

    And I was thinking as I read through the file, "Man, this syntax is very C-like; comments are even denoted by //!"
    And it turns out I have Eclipse already on my system! :D

    EDIT: Alright! I got it working! Though, I've found I harbour a deep loathing for Git! :D
    I tried to be clever (IDK why I really bother) and named the version I put out "Version 0.4 TriFix9". :rolleyes:
     
  18. Offline

    MrX13415

    I use Eclipse too.
    good :)
    and how I say, I hope Version 0.5 is ready soon ...

    Version 0.5:
    • bug fixes ... - done
    • better block protection for the block near buttons etc. - done
    • fix bug for double blocks like doors ... - done
    • permission supoort - done
    • iconomy supoort - done
    EDIT: I forgot: Thanks for finding the bug with the password ;)
    EDIT: the moust Blocks are lockable now (I mean double-blocks like doors ...) and locked chest are lockable to ... xD
     
  19. Offline

    Triforce9

    No problem, happy to help! :D
    It'll be nice to have double-blocks lock their other half! I didn't even think of it as a bug, I just took it in stride.
    Though I did get tripped up, thinking I hadn't added WOODEN_DOOR to the config.yml, lol. :rolleyes:
     
  20. Offline

    MrX13415

    In the Version 0.4 you must lock each Block: so twice for a double-chest.
    And I must improve the list above for the lockabel Blocks becuase only WOODEN_DOOR works WOOD_DOOR and IRON_DOOR (use IRON_DOOR_BLOCK) does not ...

    Version 0.5:

    • bug fixes ... - done
    • better block protection for the block near buttons etc. - done
    • fix bug for double blocks like doors ... - done
    • permission supoort - done
    • iconomy supoort - done
    Just fix some bugs ...
    and than Version 0.5 will be out !

    version 0.5 is out !

    Changelog:
    Version: 0.5
    • ADD: Permission Support
    • ADD: IConomy Support
    • ADD: More options in the config
    • FIX: Locked blocks save-file-format changed
    • FIX: Better block protection
    • FIX: Password bug
    • FIX: Double-blocks (like doors) are full lockable too
    have fun with it ;)
    EDIT: I forgot to write down the Permission nodes ... xD Now added

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  21. Offline

    Nibelton

    you should add option to give permission to certain players(locked for others),AND locked ONLY for certain players but free to use to anyone else
     
  22. Offline

    JamesS

    I used to use CodeLock before I managed to lose the jar and couldn't find it again. This however looks like the replacement I need for a very large bank holding rather a lot of wealth :p
     
  23. Offline

    MrX13415

    I used CodeLock but than it was outdate so I make may own one :D
     
  24. Offline

    Triforce9

    Nice work on the update! It's working great so far! :D

    Just a suggestion, I have no clue if it's possible (without putting extra strain on a server), but it would be nice if I could type "/pw text" and then it would send that password to the next locked block I click, instead of having to click a locked block first. ;)
     
  25. Offline

    MrX13415

    should possible ... I try to make an option :)
     
  26. Offline

    Semirotta

    wtf it denies my remove and now it locked my lever AND my damn door 1 block away from it...WTF
     
  27. Offline

    MrX13415

    to remove a block you must first remove the password with "/setpw" than you can remove it ;)
     
  28. Offline

    Semirotta

    i couldnt remove password from door or lever... first i made password for lever and then it somehow used the pass in door also.

    It was like this ( *** is stone block) -> Lever *** Door <-- there was 1 block between the lever and door, protected lever -> protected also the damn door.
    I tried to delete password from lever AND door with /setpw and it said "denied"
     
  29. Offline

    MrX13415

    OK...
    click at the door and enter the right password to unlock it...
    and then (When the door is unlocked) use '/setpw' to remove the password ...
    (make sure, that you use version 0.5)

    Version: 0.6 is out !

    New Features:
    • Single-use-passwords
    • Enter password time out
    • improved /pw command
    (see changelog)
    :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  30. Offline

    Triforce9

    Awesome! I'll have to try it out!

    BTW, I was having a problem with version 0.5, I don't know if it was just me or what, but after a few server restarts (I have my set to restart every 90 minutes) the LockedGroups.yml would get cleared. I'll see if this problem persisted into version 0.6.

    Thanks for the thanks in the credits! Lately I've been feeling like everything I do is of little merit or value, but that cheered me up! :D
     

Share This Page