Inactive [EDIT/FUN] SecretPassage v1.6 - Create Structures That Can Disappear [1.2.5-R4.0]

Discussion in 'Inactive/Unsupported Plugins' started by Professor29, Aug 13, 2011.

     
  1. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Secret Passage
    Current Version: v1.6
    Old versions available on request - Shoot me a message

    NOTICE: I finally stopped stalling and made a BukkitDev page for this project. All future updates will be posted there, and I check for messages / posts frequently... Hope to see you over there!

    Link -> http://dev.bukkit.org/server-mods/secretpassage/

    Have you ever wanted to create a wall that could disappear at a touch? Or a massive pit to trap your "friends" in? Are pistons just not enough to make the secret door of your dreams? Look no further!



    Credit:
    I did not come up with the original idea of this plugin. During the days of hMod and Alpha, I played on a server called "Kingdom of Strongholds", run by Rockslide. A few weeks before the server was shut down, a plugin similar to this one was added, and it was a blast to use. Sadly, I haven't been able to find anything like this for hMod or Bukkit, so I opted to write my own version from scratch...
    Also, I would like to thank @nisovin for helping me solve an inventory issue.

    How to Install:
    Download the .jar file from the link above (next to "Version:") and place it in your plugins folder. Start the server as normal. Then, stop the server and modify the config.yml file in plugins/SecretPassage/ to your liking. Finally, restart the server.

    How to Use:
    1) Start by building the shape of the structure out of any of the "active materials" you chose in the config. If you didn't change the config, use either Netherrack or Sponge. (I made this for a server with no nether, so netherrack isn't common...)

    2) Type in the command below to create a passage. It's worth noting that you can change the "create" part of the command in the config file, so it may be different based on what you entered.

    3) Hold the block that you want to replace the active material with, and punch it. If the material is allowed (also in config), the active material will absorb the item you're holding, and change to look like it. Repeat this until you have the structure built - you can safely place more active material if you need to, the plugin will only respond if the active material is punched while holding another item. By default, any solid block unaffected by gravity (aside from netherrack and sponge) can be used to decorate a passage.

    3b) If you punch (and activate) the wrong block, you can break it to remove it from the structure. Doing so will not return the active material used, so that will need to be placed again.

    4) Place another active block somewhere that you'll remember, then hold one of the items you chose for creating switches (in config) and punch it. The block will absorb the item and change into another material (chosen in config) to show that it is now a switch block. By default, you use a stone button to make switches, which turn into wooden planks for confirmation.

    5) If desired, break the switch block and replace with another block of your choosing. It must be selectable with a right-click to work (so no water, lava or air).

    6) Right-click the switch to test if the gate is working. If so, all the blocks you placed in step 3 will turn into air. Right-click the switch again to bring the structure back.

    7) Type the command /spass to end the passage construction process. You can always come back and modify it by using the create command again.

    New and Improved Video Version by LiekMudkipzz



    Command List:
    • /spass [Alias: /sp, /secretpassage] The main command for the plugin. Also ends the passage building process.
    • /spass create* (PassageName) - Starts building on the named passage, creating it if necessary.
    • /spass destroy* (PassageName) - Destroys a passage you own (blocks are not removed). You can give a permissions node to let people destroy any passage on the server.
    • /spass destroy* switch - Sets you up so that a switch bound to the next block you right-click on is destroyed.
    • /spass list* - Lists all the passages that you own, in order of creation.
    • /spass list* (PlayerName) - Permissions-based command that lists passages owned by the named player.
    • /spass toggle* (PassageName) - Permissions-based command to toggle a named passage, provided you are in the same world.
    • /spass reset* - Permissions-based command that resets all passages based on redstone power to switches.
    • /spass timer (ticks) - Adds a reset timer to auto-close the passage after a set delay (specifically built to prevent making it accidentally auto-open...)
    • /spass timer 0 - Removes the timer of the passage you are working on.
    • /spass info (Passage Name) - Provides information on the listed passage. If you do not give a passage name, it provides information on the passage you are working on (if any).
    • /spass help - Lists all basic commands you have access to, as well as the proper structure for typing them.
    • /spass access - Lists the commands for working with white or black lists for passages.
    • /spass access allow (Name) (Name) (Name) (Name) - Adds the names included to the whitelist of your current passage, and sets the passage to use a whitelist.**
    • /spass access deny (Name) (Name) (Name) (Name) - Adds the names included to the blacklist of your current passage, and sets the passage to use a blacklist.**
    • /spass access remove (Name) (Name) (Name) (Name) - Removes the name from the whitelist/blacklist of your current passage.**
    • /spass access clear - Removes the access restrictions on your passage, allowing anyone to use it.
    * - Create, Destroy, Toggle, List, and Reset can all be replaced in the config.yml file, to allow for ease of use.
    ** - At the moment, you must use the full name, and the player must have logged in at least once. I am working on a name-finder to allow partial names for any online players, but that is not included yet. Also, ops and anyone with the antilockout permission will be able to bypass any access restrictions, and you cannot modify the passage owner's access.

    Features:
    • Create structures that can disappear.
    • Includes option to prevent blocks in passages from being broken (to stop easy duplication)
    • Includes options to consume resources when decorating passages, as well as the ability to choose what can be used in their creation.
    • Choose your own commands to replace create, destroy, toggle, and list.
    • Includes option so that only the owner of a passage (or an op) can modify it, while anyone can use the switches made by them to toggle the passage.
    • More than one switch can be assigned to a passage, but only one passage can be assigned to a switch.
    • Passages do not have to be continuous, but cannot have blocks on multiple worlds. You could build a disappearing village if you felt so inclined.
    • SuperPerms support (as of v1.0)
    • Preliminary Redstone support (as of v1.2)
    • Ability to have passages close themselves after a set delay (as of v1.4)
    • Provide access on a passage-by-passage basis (as of v1.6)
    • If passage protection is active, pistons will break when trying to push a passage block, and cannot pull out a passage block if sticky (as of v1.6)
    Permissions Nodes:
    • secretpassage.* - Provides all nodes other than lockout and deny (Default: Op)
    • secretpassage.create.other - Allows user to bypass the owner-only protection option if it is enabled
    • secretpassage.destroy.other - Allows user to destroy any passage on server, regardless of owner
    • secretpassage.list.other - Allows user to check passages owned by other players
    • secretpassage.toggle - Provides access to the toggle command
    • secretpassage.reset - Provides access to the reset command.
    • secretpassage.lockout - Prevents user from using any portion of the plugin
    • secretpassage.antilockout - Prevents admin using all-nodes plugins from accidentally barring themselves from using plugin
    I know I stated that I wouldn't add support for any plugins to this, and I stand by that statement. SuperPerms are integrated into Bukkit itself, meaning that I don't have to worry about waiting for it to update to keep my plugin compatible with recommended Bukkit builds.

    You can use this plugin without using SuperPerms (I personally do, strange as that may sound...), as the extra features will default to Op, and everyone by default can create and destroy their own passages. However, it's worth noting that the .lockout node is checked for first, and will restrict access no matter who the person is, or what other nodes they have. This means that the server owner can actually lock other Ops out from their private area, and the plugin won't question it.

    To-Do List:
    • PRIORITY: Add ability to restrict access on a per-passage level. - in v1.6
    • Add saving of block data (for colored wool, logs, torch placement, etc) - in v0.9
    • Refine saving of block data for block orientation.
    • Allow Ops to toggle passages from any world.
    • Add timer options to passages. in v1.4
    • Add option to enable/disable based on redstone current hitting a switch.
    • Improve redstone support.
    • Add option to activate switches on left click.
    • Figure out how to make system accept things like doors and beds during placement (I feel a massive IF structure coming on...)
    Changelog:
    • v1.6 - Pistons will naturally break when they attempt to push a block out of a passage. Sticky pistons cannot pull blocks out of passages. Added the allow/deny options for passages.
    • v1.5a - The .deny permission has been a pain for several versions now, and has been removed. Working on a command-based replacement.

    • v1.5 - Cleaned up code for new syntax, as well as (hopefully) squashing the SuperPerms bug (again). Also killed the unintended bug of being able to stack timed reactivations of a passage.
    • v1.4 - Fixed logic bug in SuperPerms support, added timers and building in creative mode.
    • v1.3a - Hopeful fix for accidentally breaking protection plugins.
    • v1.3 - Tried to make redstone more multi-world friendly, added redstone options to config file, provided variable to allow automatic updating of config if needed later.
    • v1.2a - Added code to Redstone enabling process for stability.
    • v1.2 - Preliminary redstone support.
    • v1.1b - Fixed faulty logic from trying to code at 1am.
    • v1.1a - Quick fix to counter accidentally gaining the deny permission
    • v1.1 - Fixed support for new blocks, as well as removing blocks from passages.
    • v1.0 - Added SuperPerms support, putting this at a comfortable "proper release" point.
    • v0.9.1 - Bugfix for NPE in passage construction.
    • v0.9 - Added storage of block data, with legacy support for older passages.
    • v0.8 - Stable release with source included.
    • v0.1-v0.7 - Unstable versions as I destroyed bugs and added features.

    While a lot of other plugins are great matches with this plugin (iConomy, etc), I will not be personally adding support for these options. However, the source code is included in the .jar file, so that anyone who wants to make changes can take a crack at it. Sadly, I'm not the greatest at uniform code structure or commenting, so the only assistance you'll find in there is a small comment at the top of each function to describe it.

    If you add a feature that you believe should be shared (such as permissions support), I have a request: add an option to the config.yml file to disable it. If you're willing to do that, then post it here and tag me in the post, that way I can take a look at it. I'll test it and add it as a proper version, making sure to include your name in the credits section.

    This post has been edited 33 times. It was last edited by Professor29 Mar 22, 2013.
    Xilador and jesse1212 like this.
  2.  
  3. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Error. Big time... let me look into it.
  4. Offline

    mythicshadow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    ok cuz i didnt think i was doing anything wrong because in my plugins my secretpassage is a copy with a (1) so i thought that mightve been the problem but i guess not.. although that shouldnt matter
  5. Offline

    WingedSpear

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Lol, awesome, this plugin is able to replace craftbook and falsebook, we can make gates and bridges, and of course, secret passages =P

    edit: i suggest u to add stairs support =), at that way we can do anything with this plugin

    This post has been edited 1 time. It was last edited by WingedSpear Jan 17, 2012.
  6. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Nope, the (1) simply means its a duplicate, probably due to downloading two so close together. I can't seem to replicate the creative -> survival locking down the passage though... what other plugins are you using? I want to get this stamped out ;P

    I actually haven't looked into either one, but I'll look at em now, see what they're about :D

    As far as stairs, it's currently a "hopeful" feature, due to how I have the replacement system going. I need to figure out how to take the player's orientation in relation to the block, then use that to properly rotate the stair's data before adding it to the passage. Completely doable, but currently beyond my knowledge of Bukkit. I've been looking into it though, same with doors and beds.
  7. Offline

    WingedSpear

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  8. Offline

    mythicshadow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    well i have quite a few plugins. but it isnt letting me do any of the passages again so i just downloaded the no perms one and it seems to be working just fine.. i can give u a list of my plugins if ud still like to know tho
  9. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Nope, that's all I need to know - I'll be working on splitting the permissions out of the main code and into a secondary class, that way I can add a config option to use permissions. If set to false, it will default to Op like the NoPerms version, that way we can squash this bug once and for all... not sure when it will be done though, but know that it IS being worked on.

    @WingedSpear The only reason I'm hesitant to do that is the mental image of using it to build a spiral staircase, which would be quite tedious. I'm going to dig through the WorldEdit code on GitHub and see if I can find his formulas for rotation... wish me luck :D
  10. Offline

    WingedSpear

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    ic, well its still awesome, its too easy make doors and bridges with this, i dont need redstone for find an spot in my building, its like....wireless+craftbook
  11. Offline

    mythicshadow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    ok i see. but now the only problem is that since for the most part im on a private server is with the no perms it lets everyone use the switches which can get kind of annoying. but nothing to bad. just gotta hide the switches. thanks for all ur help
  12. Offline

    mythicshadow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    hey idk if ud include this in wingedspears suggestion but could u add support for like iron bars and stuff. and glass panes? cuz none of those work for me. i think thatd be amazing
  13. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Those actually work - I just didn't update the config file when they were introduced. All you have to do is add their block IDs to the list of allowed blocks - doesn't have to be in order, so just tack em onto the end. And for your switch idea, I have a question for you and @WingedSpear - would you guys like me to add a restrict command while working on the permissions changes? Example:

    After creating a pass, meatHead types "/spass restrict allow TacoMan". Because meatHead is the creator, he can always open his passages, but now only people named TacoMan can open them as well. If he wanted to add someone later, he would go into modifying the passage and type it again. Conversely, he can also type "/spass restrict deny Griefer90210" to block Griefer90210 from ever using the switches for that passage again.

    If I do this, the easiest way is going to be more small files in your plugin/secretpassage folder - I can make another folder that maintains the white/blacklists for each passage. If the passage doesn't have one, it ignores it. If it does, it loads it at startup to prevent using too much memory while running.
  14. Offline

    mythicshadow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    ya i like the idea sounds awesome, and ok thanks for the info, and i was wondering if you could also make to where i can place a actual switch on the switch block so u can press it and open the passage so like i can make a gate that people can press the switch to open? you understand what im saying?
  15. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    As counter-intuitive as it may sound, it's actually already possible - to a point. It will only function on right click, but you can replace a switch block with anything that you can click, be it a block, button, lever, redstone, even a flower if you want to... as long as you can select it, the plugin can recognize it. I just used solid blocks in the vids to make it easier, but consider that the first vid has a door where the switches should be. As far as placing a button ON the switch block, I'd just recommend moving the switch block out one square and replacing it with the button, or you could even put two switches side-by-side if you'd prefer....

    Not sure if that makes sense, but sadly life has decided to get hectic today - will resume coding tomorrow, and if my description doesn't make sense, I'll gladly post screenshots once I'm back to my comp - just leave a response.

    This post has been edited 1 time. It was last edited by Professor29 Jan 20, 2012.
  16. Offline

    mythicshadow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    haha no it makes sense. i know it souns retarded haha i come off like that alot ^^ but nah im good dont worry about it ^^ sorry for all the semi-dumb questions haha
  17. Offline

    WingedSpear

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Ya thats a good one, for a pvp server u can hide ur stuff from enemys, but they are gonna be able to open passages with a lever...
  18. Offline

    krix

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    dont have permission when im trying to test it, and im op...

    anyway, anyone have a permission bukkit? i need:p
  19. Offline

    Toasticuss

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Please make it so you can use this in creative mode!!!!!!!!!!!!!!

    The latest version makes it so you can create the passages in creative mode but the switches fail.

    The permissions fixed version you posted makes it so you can use the switches in creative mode but you cannot create any passages.

    This post has been edited 1 time. It was last edited by Toasticuss Jan 27, 2012.
  20. Offline

    leonofthewind

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    so im pretty sure you probably already answered this but maybe one directed at me will help me understand better, but i have downloaded the most recent version and it works great for everyone on my server except ops it wont allow us to activate the passages and we are using Permissions bukkit 1.2 maybe something in there is messing it up? if you could help me out here i'd appreciate it, we are trying to run an RP server and it would be awesome if we could get this up and running for ops, thanks!
  21. Offline

    davis7457

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    For some reason evrytime I make a switch and try to activate it, it sayz "your not allowed to active this passage"


  22. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Toasticuss @leonofthewind @davis7457 It's the same error I've been fighting with for a few versions. I'm going to see if there's errors in my logic for activating passages, as the switches seem to be the only problem with the SuperPerms support. Sadly, been away from my PC for the last week, so coding has been stalled. I'll be working on this and adding the new version of listeners for the plugin as soon as I get home.

    @Toasticuss The NoPerms version is actually built to work with a very old version of Bukkit (build 753), which predates the addition of Creative Mode. What's bizarre is that the code for the switches perfectly matches on both versions - the only change is me using .hasPermission() instead of .isOp(), which is why I'm flabbergasted as to why it's failing so spectacularly.
  23. Offline

    Untar1

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    A big problem-you forgot to make it so that OPs can use it too.
    Because i created a door and cant use it
  24. Offline

    Don Redhorse

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    in SPPlayerListener you have a problem with the code of the onPlayerInteract event, it should be:

    1) check if event is cancelled first
    2) check if right clicked
    3) than to do the rest

    Also I don't really know why but with '*' I get the message you are not allowed to activate switches.

    ok. I know why... line 229 in SecretPassage checks for rights secretpassage.deny.whatever... which I have, you should probably also check if people have the "admin" rights in this statement, if they have both ignore that part.

    that shouldn't happen because I have both permissions you are looking for..

    nevertheless the code flow is wrong as it will check this for every playerinteract..

    haven't really looked into the code but also it looks like SwitchBlock is missing the world information

    This post has been edited 1 time. It was last edited by Don Redhorse Jan 30, 2012.
  25. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @krix @Toasticuss @leonofthewind @Davis @Untar1 I've made changes to the code, as well as the specific part that is giving me grief. Please test 1.5 if you can, let me know if you still can't activate passages as Op (I checked it as both Op and a standard player, both for my passages and another player's).

    Thank you for the help with the code, it pointed out some bad errors I had made (including the fact that anyone unable to use the plugin would be hit with a deny message whenever they right clicked anything...). I'm hoping the change will squash the bug on activating passages, but let me know if it doesn't. What worries me is that the message should only show up when you have a specific permissions node (secretpassage.deny.thenameofthepassage), which is generated at run-time and set to false by default... any idea why it might be firing off without that? (I already added the admin check to it, for safety's sake. There's an "antilockout" perm that I added a while back due to plugins that gave all permissions nodes to users)

    Also, I'm working on the black/whitelist feature. Do you guys want it to work as both, or should I restrict to one? My current plan is to allow either, but you can change it by using the opposite command...

    This post has been edited 2 times. It was last edited by Professor29 Jan 30, 2012.
  26. Offline

    Don Redhorse

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    the code in the main plugin class didn't had that check IIRC... I'm using PEX which has the old '*' which means EVERYTHING... so also the deny rights if you check with hasPermission ..

    I know that using '*' is stupid, but I use it for testing... otherwise I have only limited rights (haven't tested that though).

    concerning if statements you should also try to test the stuff first which fails more often... saves cpu cycles.. and especially with permissions that can be a bunch... there is a plugin which does test how long it takes to figure out permissions in general
  27. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    You're correct - I added it back in. Not sure when I removed the check, as that's why the permission is there in the first place...

    I'll see what I can do about revamping the IF statements, but as a general rule the entire thing needs some cleaning... Thank you for going through the code to help, and I'm sorry for the lack of structure.... self-taught, so I build it in a way that makes sense to me....
  28. Offline

    Luneth2

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Im an OP
    and when i click it, it says im not allowed
    but normal people can do it..

    I want the exact opposide of this.

    how do i do that?
  29. Offline

    Don Redhorse

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    wait for a fix, see the last 3 - 4 messages above.
  30. Offline

    Don Redhorse

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    there is nothing wrong with being self-taught.. I just started coding again 3 month ago after more than 20 years not looking at code... and that was Turbo Pascal.
  31. Offline

    Professor29

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Grab v1.5a and you shouldn't have issues with activating. However, the plugin is designed to allow anyone the ability to activate passages, and there isn't a full lockout option without using a SuperPerms plugin. If you use one, just give your players "secretpassage.lockout" and they won't be able to access any facet of the plugin. Or, you can use the /spass toggle (Passage) command to activate them, and remove all the switches for your passages. Ops by default have access to it, while players do not, so you could lock them out that way as well.

    I actually don't know what Turbo Pascal is used for. I've heard the name, but only in passage from an old teacher who introduced me to coding by handing me a floppy disc with Quick Basic on it... I've looked at your plugins and they're all very impressive - any tips on how to improve this one?
    --------------------
    And as before: Do you guys want the restriction options to function as whitelists, blacklists, or have the option for both? I'm hoping to get input from users before just coding it and throwing it out, that way it matches your needs...
  32. Offline

    Luneth2

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)

    Will there be an update for it?

Share This Page