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


    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:

    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.

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


    Source now also available up on GitHub!

    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.

    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.
    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).
    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


    If anything, it should be BlockPhysicsProtectMode, set that to none and see if that does it. I haven't had a close look at it, will do soon.
  3. Offline


    No. It doesn't. ;)


    The first three wireblocks are not CB-controlled. The last three are controlled.
  4. Offline

    Kevin Forte

    Is this going to be updated for 600+ soon? This is one of my favorite plugins ):
  5. Offline


    I double that :)
  6. Offline


    Getting errors on the #602 recommended build, am working on fixing now :)
  7. Offline

    Kevin Forte

    Awesome :D
  8. Offline


    Done ^^ 1.16 up, fixed for #602 (and requires #602 for the API changes) Find bugs! No doubt I've missed stuff
  9. Offline


    Is using #602
    starts up with message

    15:45:20 [INFO] ControllerBlock: 1.16 by Hell_Fire
    15:45:20 [INFO] ControllerBlock: Using IRON_BLOCK (42) as ControllerBlock, loade
    d 0 disallowed types from config
    15:45:20 [SEVERE] BLOCK_DAMAGE loading ControllerBlock v1.16 (Is it up to date?)
    java.lang.NoSuchFieldError: BLOCK_DAMAGE
            at net.servfire.hellfire.bukkit.ControllerBlock.ControllerBlock.onEnable
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(
            at net.minecraft.server.MinecraftServer.e(
            at net.minecraft.server.MinecraftServer.a(
            at net.minecraft.server.MinecraftServer.d(
    Any help?
  10. Offline


    Are you sure you're using #602? That error would suggest you're still using an older craftbukkit build
  11. Offline


    Oh, some reason my plugin that updates Bukkit said it updated to #602, but didn't. Redownloaded #602 and works great!
    Sorry for inconvenience.
  12. Offline


    @ Hell_Fire:
    "added some config options" sounds very good to me. :D
    I'll update CraftBukkit (and lots of Plugins XD) on the weekend. I'll try your 1.16-build then. ;)

    Thanks for your hard work again. :)
  13. Offline


    Anyone have this to work in 1.4? Atleast for me it wont work :( Guess I have to wait for update
  14. Offline


    Dosent work for me, im placing an iron block, putting redstone ontop, left clicking on the iron with a dirt block and nothen happens after that? wat am i doing wrong??
  15. Offline


    same here all my buildings dont work and now we have bedrock lockers placed with no way of getting in them....
  16. Offline


    Check for mod conflicts, I've tested against build 617 and it's fine
  17. Offline


    Hell_Fire, is there a way to prevent duplicating items like torches, rails, etc.?
  18. Offline

    Thanks. I tried replacing the numbers with world and netherworld like the new dat does, but that didn't work.
  19. Offline


    Hrmm, that's all I'd be doing.. odd that it isn't working :/ Here's my attempt anyway:

    It used to block those items duplicating, for now though, add them to the disallowed list in the config. I haven't found the event to cancel for those objects getting acted upon (used to throw BLOCK_PHYSICS, but it doesn't anymore :/)

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


    Maybe I found the issue:

    Here's my config:
    # ControllerBlock configuration file
    # Blank lines and lines starting with # are ignored
    # Material names can be found:
    # ControllerBlockType is the material allowed of new ControllerBlocks
    # Doesn't affect already assigned ControllerBlocks
    # QuickRedstoneCheck to false enables per-tick per-controllerblock isBlockPowered() checks
    # This is potentially laggier, but blocks can be powered like regular redstone blocks
    # If set to true, wire needs to be run on top of the controller block
    # BlockProtectMode changes how we handle destroying controlled blocks
    # It has 3 modes:
    # protect - default, tries to prevent controlled blocks from being destroyed
    # remove - removes controlled blocks from controller if destroyed
    # none - don't do anything, this effectively makes controlled blocks dupable
    # BlockPhysicsProtectMode changes how we handle changes against controlled blocks
    # It has 3 modes:
    # protect - default, stops physics interactions with controlled blocks
    # remove - removes controlled blocks from controller if changed
    # none - don't do anything, could have issues with some blocks
    # BlockFlowProtectMode changes how we handle water/lava flowing against controlled blocks
    # It has 3 modes:
    # protect - default, tries to prevent controlled blocks from being interacted
    # remove - removes controlled blocks from controller if flow event on it
    # none - don't do anything, things that drop when flowed over can be dupable
    # DisableEditDupeProtection set to true disables all the checks for changes while in
    # edit mode, this will make sure blocks placed in a spot will always be in that spot
    # even if they get removed by some kind of physics/flow event in the meantime
    # MaxDistanceFromController sets how far away controlled blocks are allowed
    # to be attached and controlled to a controller block - 0 for infinte/across worlds
    # MaxControlledBlocksPerController sets how many blocks are allowed to be attached
    # to a single controller block - 0 for infinite
    # Nijikokun Permissions support
    # The nodes for permissions are:
    # controllerblock.admin - user isn't restricted by block counts or distance, able to
    #                         create/modify/destroy other users controllerblocks
    # controllerblock.create - user is allowed to setup controllerblocks
    # controllerblock.modifyOther - user is allowed to modify other users controllerblocks
    # controllerblock.destroyOther - user is allowed to destroy other users controllerblocks
    # DisableNijikokunPermissions will disable any lookups against Permissions if you
    # do have it installed, but want to disable this plugins use of it anyway
    # Note: You don't have to do this, the plugin isn't dependant on Permissions
    # Users listed in ops.txt (op through server console) counts as an admin
    # Everyone on the server can create new ControllerBlocks
    # Everyone can modify everyone elses ControllerBlocks
    # Everyone can destroy everyone elses ControllerBlocks
    # One name per line, users listed here are admins, and can
    # create/modify/destroy all ControllerBlocks on the server
    # Block restrictions don't apply to admins
    # Add disallowed blocks here, one Material per line.
    # Item IDs higher than 255 are excluded automatically due to failing Material.isBlock() check
    I set "BlockFlowProtectMode" and "BlockPhysicsProtectMode" to "remove", but EVERY time I restart server, plugin recreates them at the end of config file, with "protect" parameter, so there are multiple entries with different parameters.
  21. Offline


    Ack, thanks for the report and the hunting! I'll fix this up right away and release a new version, since this cluttering config files is a really bad thing >.<

    New version up, fixed that, thanks :)

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


    Oh, thanks for your wonderful plugin :D

    Just tried, it works flawlessly! No more duplication ^^
  23. Offline


    I have an issue with sand duplication at the moment, and its quite complex to explain.
    Firstly I made a wall out of stone 5 wide, 1 thick and 5 up.
    Then I placed a ledge on the 4th row up, and made a controller block nearby and power it and attached a lever.
    Next I used SAND on the controllerblock and placed it on the ledge, pulled the lever so it disappeared and removed the ledge.
    At this point you could repeatedly turn the controllerblock on and off to receive 4x as much sand, on a small scale..

    Am I doing it wrong? :eek:

    EDIT: Due to the sand not falling during the editing, it doesn't recognize it will fall when the ledge is removed.
  24. Offline

    tha d0ctor

    Could there be a function that creates an iron block/whatever item at the config coordinates in the world if one doesn't already exist there. I had a chunk disappear in my world and the blocks are still in the configs but not visible and it'll be quite hard trying to guess each block in the very large area :/

    Thanks! I can't thank you enough for the plugin!
  25. Offline


    if you press f3 it will display amoung many things your exact x y z coords updated as you move about, should help you locate waylaid ironblocks
  26. Offline


    Very pointless, but fun plugin! (You may want to change your title ([MECH] ControllerBlock v1.17 - Toggle blocks on/off with redstone [602] to [MECH] ControllerBlock v1.17 - Toggle blocks on/off with redstone [617]))
  27. Offline

    tha d0ctor

    thanks I aprreciate the help!
  28. Offline


    Ok, after testing it, I can say that duplication is still here, even with BlockPhysicsProtectMode=remove

    I tried all settings combinations, but no way.... :(
  29. Offline


    Check that you actually got 1.17, occasionally browsers cache the old version :/ The version is in the loading message when the server starts up.

    Also, certain things got changed to not have the BLOCK_PHYSICS event thrown for them anymore, torches and whatnot, noones responded to me as to if there's another event or anything to cancel these, so the protection is pretty limited :/
  30. Offline


    sure, 1.17 with CB617...

    Do you confirm it's working?
  31. Offline


    Yeah, except for torches, cactus seems to stay put, but toggling at least the redstone torch causes a drop, :/ Could be a bug in craftbukkit... (Edit, ugh, sand isn't getting cancelled either :/)

Share This Page