Inactive [MECH] ControllerBlock v1.18 - Toggle blocks on/off with redstone [740]

Discussion in 'Inactive/Unsupported Plugins' started by Hell_Fire, Jan 24, 2011.

  1. Offline

    Hell_Fire

    ControllerBlock - Toggle blocks on and off with redstone

    I've stopped work on this plugin due to other work, please see Zero9195s continuation of this plugin here: http://forums.bukkit.org/threads/34394/

    Pretty simple, there was a version of this for hmod, so the inspiration comes from that.

    Iron blocks can be turned into controller blocks. Drop the block down, drop a redstone wire or torch on top, switch to the type of block you want to toggle and smack the iron block with it. (Can remove redstone on top after it's been set as a ControllerBlock).

    Place those blocks down where you want them to be, you can work from multiple piles of it, where it is in the inventory doesn't matter, as long as you place the block of that type.

    Once you're done placing blocks, wack the iron block again and it'll save the block locations and ready to go. Power the block they'll appear, remove the power and they'll disappear again. Invert the control with a redstone torch on top of the block. To remove the binding, just remove the block.

    Source is included in the .jar file in case I disappear. Tested on my local server but other than that, not much else. Sure you guys will find me bugs :)

    A smallish howto of how to make blocks, and change between types.


    Features:
    • Redstone toggleable blocks
    Download ControllerBlock (recommend using the recommended build of craftbukkit here, previous version available below in the changelog, tested up to 733).

    NOTE: IN 1.07 CREATING CONTROLLERBLOCKS CHANGED, YOU NEED TO PUT A REDSTONE TORCH OR WIRE ON TOP OF THE BLOCK BEFORE YOU LEFT CLICK ON THE BLOCK TO CREATE. (Yes, enough people have missed this change to warrant the large bold text :p)

    Source now also available up on GitHub! https://github.com/Hell-Fire/ControllerBlock

    Some builds done with ControllerBlock:
    Treasure Quest 3 (dungeon game inside MineCraft) (by neoguy21)
    Xtreme HowTo controller blocks (by mrgreaper)
    :getout: frog animation (by Gorbachev, sup goons :V)
    gravity mob trap (by Arolathe)
    hidden staircase/entrance (by narrowtux)

    And a couple by me:
    Real simple on/off example/howto
    Item elevator
    Portcullis/castle gate build/howto (long >.<)

    Known Issues:
    - Placing a block in snow/flowing water/lava doesn't register.
    - Occasionally block hits/places/destroys don't register.
    - Liquids being directly controlled don't work properly.

    Changelog:
    Version 1.18
    - Updated for craftbukkit #733
    Version 1.17
    - Fixed config loading of BlockFlowProtectMode and BlockPhysicsProtectMode
    Version 1.16
    - Fixed for changes to bukkit/craftbukkit #602
    - Changed some messages, added some config options, haven't slept much, so forgotten a bit of what's changed, find bugs! :)
    Version 1.15
    - Fixed up multiworld, also loads the data file after all the other plugins have loaded.
    Version 1.14
    - Changed world to use name instead of the ID in data file, should fix multiworld stuff when ControllerBlock loads before other multiworld initializing plugins.
    - Not much else that I recall, will be another version soon
    Version 1.13
    - New config patcher, new options get added into the ControllerBlock.ini automatically.
    - Added a whole lot of currently disabled debug lines (They're spammy... really spammy).
    - Added option to disable the edit dupe check all together.
    - Added protection against water/lava flows (and dupe checks, that are disable-able with the above new option).
    - Added ability to disable the checks against Permissions (and clones) completely, if you want to just use my inbuilt controls only (not mandatory to set if you don't have Permissions, this is in addition to, if Permissions isn't installed, it won't use it anyway).
    - Fixed Grass/Dirt and Redstone Torch On/Off in the edit dupe checks. No other blocks are coming to mind that change automatically.
    - Added a bunch of error checking on the loading of the ControllerBlock.dat, hopefully will give me some clues as to what's going on there.
    Version 1.12
    - Removed plugin constructor for craftbukkit-419+ (wasn't needed anyway)
    - Fixed Permissions mod checking stuff (haven't tested it actually works with permissions, but doesn't seem to throw any errors on loading anymore)
    Version 1.11
    - Fixed a bug that mostly affected Windows users with .dat handling (wasn't closing the file on reading, so it couldn't overwrite it when saving).
    - Added some sanity checking to reading the .dat file (empty lines ignored rather than creating null controllerblocks that make the mod unable to save).
    - Destroying a block in edit mode that has more than one controllerblock controlling it will replace the block with the type from the enabled controllerblock.
    - Destroying a controllerblock now destroys all the controlled blocks and refunds them all at the controller block itself.
    Version 1.10
    - New antidupe code, a lot more reliable!
    - Fixed permissions check (uninitialized objects are a pain :p)
    Version 1.09
    - Fixed a rather critical bug that was saving the new data format with the old identifier.
    -- (YOU ONLY NEED TO DO THIS IF YOU USED THE BUGGED 1.08) --
    If affected by this (getting NumberFormatException on loading), edit ControllerBlock.dat with a text editor and change the first line from "# v2" to "# v3" (That's <hash><space>v3).
    -- (YOU ONLY NEED TO DO THIS IF YOU USED THE BUGGED 1.08) --
    Version 1.08 - critically bugged, don't use, use 1.09 instead
    - Added a builtin permissions support, also supports Nijikokuns Permissions on top of it
    - Removing the controller block with WorldEdits superpick, and possibly any of the "stick" plugins that cancel/set to air on hit will now remove the controller block.
    - Added configurable limits on number of blocks and block distance from controllerblock (is a "sphere" around the controllerblock, rather than a cube, might add another option to change it later).
    - Probably some more random little bugfixes/refactoring, but I can't remember >.<
    Version 1.07
    - Updated for API changes (bukkit-144/145 and craftbukkit-323, tested with 326)
    - Config file format change, old config files will convert automatically
    - ControllerBlocks need a redstone "thing" (wire/torch) on top to create a ControllerBlock
    - Added per-tick, per-controllerblock .isBlockPowered() check for more natural redstone integration (power feeds into the block rather than needing wire on top), more CPU hungry, toggleable with old quick REDSTONE_CHANGE event method in config (quickRedstoneCheck=true for fast version that needs wire on top of block)
    Version 1.06
    - Updated for API change (bukkit-128/craftbukkit-281, only tested with 289)
    - Added counts on block add/remove messages
    - Added notice if a block gets removed by the anti-dupe code while editing
    Version 1.05
    - Updated for API change (bukkit 122/craftbukkit-265)
    - If you're running a version prior to this, you can still find 1.04 at here. I won't be supporting it anymore though, so any bug fixes, etc, won't find there way backported there.
    Version 1.04
    - Moved config/data to plugins/ControllerBlock (or whatever getDataFolder() is). Should make it multi-server usable as long as each server has a different plugins dir.
    - Sorted out minecart track metadata storing, this should make dynamic minecart tracks actually stay how you put them out now.
    - Stacked fences should work again now.
    - Probably some other small bugfixes that I've lost track of.
    Version 1.03
    - More refactoring
    - Inverted blocks again, blocks on when redstone wire off, reads from torches now, blocks on when redstone torch on.
    - Added some error handling in the config file loading
    - Fixed a metadata handling bug when a block has more than one controller.
    - Listen to event cancellations, no longer processes canceled events.
    - Changed a bunch of the edit mode handling, still similar to how it was, just with some nice changes (no longer need to exit editing one block to edit another, will save/finish the previous block for you).
    - Can now edit/modify ControllerBlocks that were made with a different Material before a configuration change took place, Material only matters for creation of new blocks.
    Version 1.02
    - Whole lot of code refactoring
    - Blocks on when redstone on (can still use torches)
    - Block protection for controlled blocks (Physics events can't modify controlled blocks anymore, fixes duping issues, but allows some odd builds, might implement a "break" feature like the original had, where block changes cause the controllerblock to disable)
    - Added configuration file (creates on first load, in main folder, ControllerBlock.ini). First line is ControllerBlock material type, other lines are disallowed materials.
    - Saves block metadata, allows toggling of minecart tracks.
    - Probably some other stuff I'm forgetting.
    Version 1.01
    - Added controlled block checks, need to edit block before removing controlled blocks
    Version 1.0
    - Release
     
  2. Offline

    Tealk

    i mean that
    ControllerBlockType=IRON_BLOCK
    that sing up by command not by config file
     
  3. Offline

    Hell_Fire

    I might add a configurable command that would act as a once off, making the next block placed act like a ControllerBlock, but I haven't done any SERVER_COMMAND type stuff yet, so may take a while. As for saving settings back to the config file, hrmm.. maybe... but configuring in game doesn't really suit the mod, and adding features you'd use once off takes a lot of implementation and testing to make sure it all works right, easier to just set it up in the config and forget about it.
     
  4. Offline

    Tealk

    but if in a wall of a wood house is a iron block it looks verry bad
    that command should not edit the config file, it should sign blocks as controller blocks
    so that you dont need this line
    ControllerBlockType=IRON_BLOCK
     
  5. Offline

    Protocteur

    You can use the worldEdit command : "//repl <block_id>" to make the controller block look what you want after placing it. Its work perfectly on my server. :)
     
  6. Offline

    Tealk

    ah ok thanks if this run, perfektly
     
  7. Offline

    Hague

    Has anyone gotten a version of this to work with the latest build? An update would be grandly appreciated :D I play on a deathban server and I've gotten the admin to agree to use CB if it were updated.
     
  8. Offline

    Hell_Fire

    I've been using the 1.18 on 818 quite successfully, however some of the block protection is bugged a little, so he may want to add torches, redstone stuff, and ladders to the list of things you can't control.
     
  9. Offline

    Hague

    Cool. I'll talk to the admin and see if he's willing. We won't be using block protection anyway
     
  10. Offline

    Onza40

    Confirmed working with the latest version, but you have to set the block protect mode to protect.
     
  11. Offline

    Bashoogers

    Works good but there is a problem.
    People can only make 7 controllerblocks, then it will not work anymore.
     
  12. Offline

    Hell_Fire

    Seems a weird number to stop on, any errors on the console?
     
  13. Offline

    Bashoogers

    Jep, some errors but i dont see a name of controllerblocks.
    Only if users leave it will give error
     
  14. Offline

    dvdbrander

    don't know what you mean with wierd number:
    1 2 4 8, 4 bits, 1 till 8 or 0 till 7.
     
  15. Offline

    Hell_Fire

    Yeh, except ControllerBlock doesn't use anything that would be 4 bits long, hence, weird number for this case
     
  16. Offline

    Lyze

    The First 1st Day it Worked Byt Now It Doesn't Work AnyMore :(
     
  17. Offline

    t2wave

    Now if only we had any information about your server like CB version, error messages, or anything like that. Because then he might be able to help you.
     
  18. Offline

    neoguy21

    This is an awesome plugin! love it.. so much is possible.. i used this to create a dungeon game called Treasure Quest III.. have a look..​
    would you consider adding my video to the list? thanks..​
     
  19. Offline

    Kalais

    For some reason, people without permissions are able to use this.
     
  20. Offline

    jrtc27

    Firstly - great plugin! On my server, however, we wanted to be able to use the plugin to reset the blocks for a spleef arena, so I edited the source and made my own. This works in the same way, but as well as having iron blocks, gold blocks allow the blocks being controlled to be destroyed when unpowered, and do not set them to air when powered. Sorry if any of this is unclear - it is 1:00 in the morning where I live! Anyway my custom version of the plugin can be found on my site.
    Please note: This version will spew errors if you try and load it after having used the normal version and added controller blocks. Fixed.

    @Hell_Fire: Feel free to take this and make it more friendly - my method does not support old save files and does not have a configurable block type. Just please credit me if you incorporate this :)

    EDIT: I have gone ahead and added some more things. Firstly, the way the protected nature of the block is stored in the .dat file has been improved (no longer 1/0 which could be misinterpreted as a location value), and so now if there is no indicator as to the protected nature of the block it will load correctly as a standard protected block. Also I have added two properties to the config file - `SemiProtectedControllerBlockType` and `UnProtectedControllerBlockType` (you will probably need to add these manually under the `ControllerBlockType` entry) to customise the blocks used for the new controller block types. This brings me on to my final point - the unprotected ControllerBlock (defaults to a diamond block) which allows the blocks to be destroyed whatever the redstone state of it (I have no idea what this could be used for, but it was easy enough to add). If you find any bugs, please let me know. This newer version can be found at the old link above.

    @Hell_Fire: The source is still included in this version, so please feel free to take this - note: I would like credit :)
     
  21. Offline

    colin8696909

    this is probably my favorite plug in of all time. if it seems complemented trust me it's not, the video just makes it seem that way. also (THIS IS A AWESOME TRANSMITTER.) it's really is the only transmitter out there that will get the job done.
     
  22. Offline

    Imakunee

    Please PLEASE allow redstone dust to be used as a settable item. I have sooo many ideas for interesting constructs using redstone dust that you can spawn in but it won't let you since it fails the isBlock check. :/
     
  23. Offline

    Hell_Fire

    Permissions support is optional, by default, everyone is allowed to build, check the ControllerBlock.ini, you need to disable the global allows first, then permissions takes over.

    Love it! Added, thanks :D

    I actually had a similar idea, exactly the same reasoning behind it too, haha, I'll take a look at your changes, reformat them if needed and merge them in, thanks :) Credit always given :)

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

    jrtc27

    Great! I don't think much needs to be changed, but there may be some other code that can be stopped from running in certain cases to optimize it. IMO, you should have your source on GitHub, as then the community (like me) can submit patches more easily and file bug requests etc.
     
  25. Offline

    Hell_Fire

    I've thought about setting up a github account, this might spur me on to get to it :)
     
  26. Offline

    Drength

    After moving to a new server and updating to 1.6 ControllerBlock has been a bit laggy (The console does get spammed with cannot keep up messages when mechanisms are activated). So I was wondering what the likely bottlenecks for it are. We did go from 4 to 3 gb of memory but moved from a cable modem to 1 gb internet connection. Would that extra gig of ram be that big of a deal?

    Thanks.
     
  27. Offline

    MatCat

    Last updated for RB740, every once in a while I get server crashes from ControllerBlock, not sure what exactly causes it but it comes from redstone current being switched on to it, the controller block setups I have seen that cause crashes tend to involve loops.
     
  28. Offline

    Masau

    Oh wow. I hadn't been aware that anyone had taken this over when I disappeared back in late December or early January. I almost had it rewritten for bukkit when a minecraft update increased resources used by servers enough that I couldn't host a test server anymore -- and my friend stopped being able to host a private server -- and I more or less rage-quit development.

    I'm a bit disappointed with some of the feature loss from the old hmod version, namely the ability to use one controllerblock to set active and inactive (i.e. stone when powered, dirt when unpowered) rather than needing two + wiring, and the ability to use more than one block type per controller.

    On the other hand, doing away with the rune system (which was incredibly annoying and confused several people) is definitely a plus. And of course the various bug fixes that came with it being written from scratch, many of which were hard to remove due to the storage system that was used in the hmod version.

    Also, is your version compatible with MoveBlock (and other similar plugins)?
     
  29. Offline

    TheDaddyPeanut

    Could you please update? I think this plugin cause lagg because its not up to date.....
     
  30. Offline

    Hell_Fire

    I now have a github! https://github.com/Hell-Fire/ControllerBlock
     
  31. Offline

    colin8696909

    although this is a good mod the previous smp version of this was far superior. this is what it had that you may want to improve on.

    1. the blocks were set on by default not off.
    (it's a little annoying that i have to hook my block up to redstone all the time.)

    2. you could actually toggle between blocks. so you didn't have to set up two control blocks to switch.

    i may include a link to the old version of this when the forms are back up maybe you can use the java code in this plugin.
     

Share This Page