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


    Works fine on my 1.4 server but for my main 1.3 server nothing is happening when i lift click the iron block :/
    wat can i do to fix that???
  3. Offline


  4. Offline


    Use 1.15 which is the last version to support 1.3. I'm not going to backport fixes into previous versions.
  5. Offline


    I tried disabling all plugins, both in build 612 & 617 so only thing I have is controllerblock plugin active, the error I get is in the screenshot if you might have an idea whats causing it?

    Thanks in advance!
  6. Offline


    I can duplicate torches and redstonetorches, levers, stone buttons, rails, flowers and mushrooms, sand and gravel... and torches don't stay in place correctly when BlockPhysicsProtectMode=remove

    I think I need to blacklist these items until you fix it :(

    By the way Hell_Fire, keep up the good work and thanks again for you wonderful plugin :D
  7. Offline


    Ahh, crap. You installed a multi world plugin before updating ControllerBlock, which has messed up your world IDs, if you edit the ControllerBlock.dat file and replace all the world IDs with the world name, and change the version number on the first line from v3 to v4, you can recover from it. If you can't work it out, copy the contents of ControllerBlock.dat to pastebin, and let me know your world names and I'll see if I can.
  8. Offline


    Not sure why you think it is pointless... This plugin allows for all sorts of things from contractable bridges, to secret doorways, to not seecret doorways, to traps, to animations, the list goes on and on. My server people use it mostly for Glass doors to their shops and businesses attached to pressure plates on either side.
  9. Offline


    I changed to #4 in beginning now and that stopped some of the errors but apparently I can't log in to server when I did it :). Here is the link to the image with the new errors after changin v3 to v4:

    But about the world IDs, I do not realy know which one to change in the line, here is a short example I had in the dat file:
    My default world folder is just called "World" so
  10. Offline


    You'll want to change the all the references to -2654874851115907163 to world (or World, if your world is actually capitalized).
  11. Offline


    One of my ops just notified me of a bug, not sure if it's known but... i'll just leave this pasta here to make my life a little easier

  12. Offline



    I WAS running CB RB493 with ControllerBlock v1.15, and everything was working fine. I've recently upgraded to RB617 w/ ControllerBlock 1.17. This is the only plugin I'm running at the moment. I started the server up with just the ControllerBlock.jar, let it generate a new config file, changed the config options to suit my server then copied over the ControllerBlock.dat file from my old server.

    When I set QuickRedstoneCheck=true, server startup warns that command is deprecated, etc. but doesn't throw any errors. It's only when I flip a lever that it throws an error, which I guess would be because the API call *IS* deprecated. This is how I USED TO have it set running 1.15.
    Console Log (QuickRedstoneCheck=true) (open)
    17:45:18 [INFO] Starting minecraft server version Beta 1.4
    17:45:18 [INFO] Loading properties
    17:45:18 [INFO] Starting Minecraft server on *:25565
    17:45:18 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-612-g4c7a9e7-b617jnks (MC: 1.4)
    17:45:18 [INFO] Preparing level "Ninjaville_I"
    17:45:18 [INFO] Preparing start region
    17:45:18 [INFO] 144 recipes
    17:45:19 [INFO] Preparing spawn area: 69%
    17:45:20 [INFO] ControllerBlock: 1.17 by Hell_Fire
    17:45:20 [INFO] ControllerBlock: Using IRON_BLOCK (42) as ControllerBlock, loaded 4 disallowed types from config
    17:45:20 [INFO] ControllerBlock: Enabling 'quick' redstone check - this mode of operation is depreciated and may be removed later
    17:45:20 [INFO] ControllerBlock: Events registered
    17:45:20 [INFO] Done (0.153s)! For help, type "help" or "?"
    17:45:20 [INFO] ControllerBlock: Loaded v4 data - 30 ControllerBlocks loaded
    17:45:37 [INFO] SliMeY_G [/] logged in with entity id 43
    17:45:45 [SEVERE] Could not pass event REDSTONE_CHANGE to ControllerBlock
            at java.util.ArrayList$Itr.checkForComodification(
            at java.util.ArrayList$
            at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.turnOff(
            at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.doRedstoneCheck(
            at net.servfire.hellfire.bukkit.ControllerBlock.BlockListener.onBlockRedstoneChange(
            at org.bukkit.plugin.RegisteredListener.callEvent(
            at org.bukkit.plugin.SimplePluginManager.callEvent(
            at net.minecraft.server.BlockRedstoneWire.a(
            at net.minecraft.server.BlockRedstoneWire.g(
            at net.minecraft.server.BlockRedstoneWire.a(
            at net.minecraft.server.World.k(
            at net.minecraft.server.World.h(
            at net.minecraft.server.BlockRedstoneWire.g(
            at net.minecraft.server.BlockRedstoneWire.a(
            at net.minecraft.server.World.k(
            at net.minecraft.server.World.h(
            at net.minecraft.server.World.f(
            at net.minecraft.server.World.b(
            at net.minecraft.server.BlockRedstoneTorch.a(
            at net.minecraft.server.World.a(
            at net.minecraft.server.World.h(
            at net.minecraft.server.MinecraftServer.h(

    When I set QuickRedstoneCheck=false, again startup is fine, but when I flip a lever I get the following errors:
    Console Log (QuickRedstoneCheck=false) (open)
    17:42:00 [INFO] Starting minecraft server version Beta 1.4
    17:42:00 [INFO] Loading properties
    17:42:00 [INFO] Starting Minecraft server on *:25565
    17:42:00 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-612-g4c7a9e7-b617jnks (MC: 1.4)
    17:42:00 [INFO] Preparing level "Ninjaville_I"
    17:42:00 [INFO] Preparing start region
    17:42:00 [INFO] 144 recipes
    17:42:01 [INFO] Preparing spawn area: 69%
    17:42:01 [INFO] ControllerBlock: 1.17 by Hell_Fire
    17:42:01 [INFO] ControllerBlock: Using IRON_BLOCK (42) as ControllerBlock, loaded 4 disallowed types from config
    17:42:01 [INFO] ControllerBlock: Enabling full redstone check
    17:42:01 [INFO] ControllerBlock: Events registered
    17:42:01 [INFO] Done (0.153s)! For help, type "help" or "?"
    17:42:01 [INFO] ControllerBlock: Loaded v4 data - 30 ControllerBlocks loaded
    17:42:05 [INFO] SliMeY_G [/] logged in with entity id 59
    17:42:09 [SEVERE] java.util.ConcurrentModificationException
    17:42:09 [SEVERE]       at java.util.ArrayList$Itr.checkForComodification(
    17:42:09 [SEVERE]       at java.util.ArrayList$
    17:42:09 [SEVERE]       at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.turnOff(
    17:42:09 [SEVERE]       at
    17:42:09 [SEVERE]       at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    17:42:09 [SEVERE]       at net.minecraft.server.MinecraftServer.h(
    17:42:09 [SEVERE]       at
    17:42:09 [SEVERE]       at
    17:42:09 [SEVERE] Unexpected exception
            at java.util.ArrayList$Itr.checkForComodification(
            at java.util.ArrayList$
            at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.turnOff(
            at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
            at net.minecraft.server.MinecraftServer.h(

    I don't know if it's useful, but having QuickRedstoneCheck set to TRUE allows the lever to continue to switch backwards and forwards. Setting it to FALSE does not. It'll flip once then locks in place.

    Here's a cut-down version of my settings file (all comments have been removed for ease of reading:
    ControllerBlock.ini (open)
    # ControllerBlock configuration file

    Any help would be greatly appreciated. If you need more information, please let me know. I'd really not want to re-set all 30 redstone controllers.

    Many thanks - SliMeY.
  13. Offline


    Hrmm, that's an odd one, they're actually the same error (just the method of checking/calling changes between those two settings). Try out 1.18-test and let me know if it's fixed the problem.
  14. Offline


    Ok that did the trick, many thanks for your help in this matter, had so many controller blocks in our world and you saved us all! Thanks again! Keep up the good work!
  15. Offline


    Sorry Hell_Fire, this time the error fired off on startup with 1.18-test:

    Good news! I've got it working under 1.17!

    I have ControllerBlocks that control Redstone Torches, which in turn power/de-power a ControllerBlock that controls Cobblestone blocks (I have a central room on my map which controls all my redstone stuff, and switches elsewhere on the map).

    It turns out it was the 'BlockPhysicsProtectMode'. When it was set to 'remove', flicking the lever would play with the redstone state. When setting it to 'protect', everything is fine.

    I've adjusted my config to suit, and it works brilliantly now! :D
  16. Offline


    Needs permissions support... Please.. =(
  17. Offline


    While not readily apparent, you'd actually have to read the change log to find it, this plugin does have Permissions support. The following can be located in the ControllerBlock.ini file:

    - controllerblock.admin - User isn't restricted by 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
  18. Offline


    Can you make this compatible with CB 670 because it is not.?
  19. Offline


    it is compatible with 670 cus i use it on 670 and works perfectly
  20. Offline


    Ahhhh ok.
  21. Offline



    Using Craftbukkit 670 and I'm getting the following error after the "Done" message:

    2011-04-11 16:51:21 [SEVERE] java.lang.NullPointerException
    2011-04-11 16:51:21 [SEVERE]     at net.servfire.hellfire.bukkit.ControllerBlock.Util.formatLocation(
    2011-04-11 16:51:21 [SEVERE]     at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.<init>(
    2011-04-11 16:51:21 [SEVERE]     at net.servfire.hellfire.bukkit.ControllerBlock.ControllerBlock.loadData(
    2011-04-11 16:51:21 [SEVERE]     at
    2011-04-11 16:51:21 [SEVERE]     at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
    2011-04-11 16:51:21 [SEVERE]     at net.minecraft.server.MinecraftServer.h(
    2011-04-11 16:51:21 [SEVERE]     at
    2011-04-11 16:51:21 [SEVERE]     at
    2011-04-11 16:51:21 [SEVERE] Unexpected exception
        at net.servfire.hellfire.bukkit.ControllerBlock.Util.formatLocation(
        at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.<init>(
        at net.servfire.hellfire.bukkit.ControllerBlock.ControllerBlock.loadData(
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(
        at net.minecraft.server.MinecraftServer.h(
  22. Offline


    When i try to destroy the iron block after finish editing it goes as normal but when i place the block i used it still add up even though i clicked finished editing any idea?
  23. Offline


    Am taking a look at changes now, will see what's up.
  24. Offline


    i'm not getting any error, though i cant get rid of a block. i can break it, but it doesnt register its been broken.
    everything still thinks the block exists. if i put a new block there, it retains the old blocks function, and wont allow me to use a different material etc.
  25. Offline


    Do not use a plus sign in the RB version, you should state the latest tested version.
  26. Offline

    Kevin Forte

    Is it possible for you to make it so that TNT connected to a controller block will still explode normally, but reappear normally as well? I was planning on making a large, controller block + stone panel based game of Minesweeper but unfortunately TNT hooked up to controller blocks doesn't explode ):
  27. Offline


    Working on 670?

    Should change the title if it dose.
  28. Offline


    i had a server wide controller block crash :(
    all left there controlled blocks on no matter what... tested fully to find problem including destroying the controller and redoing it...ended up uninstalling and re installing...
    no idea why it happened either
    i re made every single controller block and started building again and it glitched again...yet again not a single one will toggle anymore...although it will show when put into edit mode but will not toggle from an input of any kind
    that last time was fixed via reboot of the server unlike the first time that did not work
  29. Offline


    Ugh, got distracted while testing, gonna get a look at this right after I've had some sleep
  30. Offline


    *Is eagerly awaiting update* Controllerblock is among my favourite mods, I really hope it can get fixed soon. Plus there's some fun things I plan to do with it on a server :3
  31. Offline


    For people having problems with this plugin against 670 and 677, could you test out 1.18-test. I think I've got it working again, but I'd like some other people to check (as always, back up your plugins/ControllerBlock folder, shouldn't cause any problems though)

    Edit: Is late here, pretty tired, but got an hour or so playing about with it, hopefully this fixes the loading problems, not sure on some of the other bugs recently reported, but my quick testing with creating, editing, destroying, etc seemed okay...

Share This Page