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


    I was offering to help you out with your plugin by giving you a LIVE server running your software on which to play around. Yes, I sounded smarmy, because I'm getting irritated. You say you're working on this and that, but you rarely update, and there's been damn near zero forward movement on the order of bugfixes for a long time now.

    I know you're a hobbyist; I get that. That's okay, and I'm not trying to start shit with you over your development speed. The thing that has me irritated is how you say "I'm developing it. Should be fixed soon." so we all wait around to see what happens and nothing does. We start asking questions, again, to which you say "I can't fix it. I can't reproduce the problem." Okay, great. "Why did we have to ask to get that information? Well, no matter. Let us help you. Here's a server with the problems. Come play with it." And then fucking nothing. Crickets.

    Either make it abundantly clear that you will only update this when you feel like it, and you have a life and such, or tell us you're working your ass off and then actually do. Don't lead people to believe that you're slaving over an unsolvable problem when you clearly aren't.

    Now that this stupid mess is behind us (I hope), is there any good in me giving you the ability to mess with the software in its glitchy state on our server, or do you have this under control?
  3. Offline


    Still sounds like a bug, I'll check the remove code.

    It's more a problem of duplicating the results, and then going through disabling every other plugin one by one till it doesn't do it anymore, then checking what the other plugin is doing that's throwing mine off, then seeing if it's a bug with either my plugin, the other plugin, or craftbukkit itself. Depending on the number of plugins, it could take hours. If you can narrow it down to what other plugin it's having problems with, great. At the moment I'm working on some scalability and performance things (have one controller block toggling 200000 blocks at once), so little occupied.

    Ugh... even with 20k blocks... setType them to air, 1-2 seconds, setting them to dirt, 65 seconds >.<

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


    It dont go, i add blocks on the Iron Block but when i try the lever nothing happened.

    Help pls with 1.4 had work it
  5. Offline


    I do not understand why some people are having such difficulty. This plugin has worked fine for us with both build 733 and 740. Prior to this, it worked with 617 on 1.4. We have not had ANY interruption in the operability of this plugin because we did not download the latest Minecraft and CraftBukkit builds until they were thoroughly vetted. This is what responsible server admins do. They test and make sure it is safe to update before they upgrade a production server so that they do not cripple their users.

    If you are not going to perform due-diligence testing on your own server, please do not expect the plugin author to do it for you. The problem (if you are running the current recommended CB build and v1.18 of ControllerBlocks) is not with THIS plugin. It is with YOUR server environment. Narrow down the problem (most likely a conflict with another plugin) and perhaps Hell_Fire can help. Until you do this, however, it is ridiculous to expect Hell_Fire to troubleshoot your problems for you. Is this really so difficult to comprehend?

    That being said...

    Are there any plans to add database support to this mod? I wonder if it will help with large pools of controlled blocks? ControllerBlocks is becoming more popular to our users and our users are becoming more bold with their controllers. :)

    Thanks for all your hard work on a great mod!
  6. Offline


    yeah, working great here on CB740 for me as well... I think the only complain I have is using a redstone torch to reverse it, I can't figure out how to reverse it and still have it attached to a switch or button because the torch gives it power the entire time
  7. Offline


    Work this plugin not with Jobs v1.3.3 ?
  8. Offline


    I have found when you put about 30k blocks into the list it really starts to eat up memory.
  9. Offline

    Dino Filippini

    I have been experimenting with the sheer quantity of blocks added to a controller. Our server is very unstable as of now, and I am wanting to relate it to the immense size of some of the controller blocks. Is this a logical assumption?
  10. Offline


    Number of blocks added doesn't do too much till you start getting into thousands on thousands of blocks, in my efforts to narrow down if it's slowness coming from controllers or bukkit, setting the type on 20k blocks to air only takes a couple of seconds, setting the type back to dirt takes over a minute, so I'm fairly confident the slowdown isn't coming from the controllers, but until I can point to where in the craftbukkit code it's coming from, I can't say for sure.

    Ahh, databases are nice and all, but at the moment, controller blocks are just all loaded into memory when the server loads, and dumped out to files on saving. Is quicker than the overhead of accessing a DB. The load and save code doesn't take all that long to parse everything or convert it back to strings, and the write to disk is done in one big lot, not lots of little writes, so it shouldn't get IO bound all that quick, if you use async filesystems, it'll just all get dumped into write cache till the disk has time to commit it, though I will check the save code with my large block test set I've got going now.

    Each ControllerBlock is only one Location, a Material, a owner String, a reference and a couple of booleans, so all up is only likely to be maybe half a K, maybe 1K (depends how wasteful Java is on some of those objects) and each block controlled is only a Location and a byte (for metadata), so maybe .2K (again, I'd need to check how much memory a Location takes up, can't imagine it'd be all that much, is really just 3 floats, a string, a long, and some references I think), so even if you throw a lot of blocks at it, it should still come up pretty low (couple of meg).
  11. Offline


    Herp Derp we never had a problem therefore it couldn't POSSIBLY be an issue with the plugin, especially if everything else is working as it's supposed to. That MUST mean it's something else and we shouldn't even bother to check(!)
  12. Offline


    Is it possible to change the controller block into gold or something else, because i have got the piston plugin too wich also useses the iron blocks.
  13. Offline


    Change it in ControllerBlock.ini
  14. Offline


    Im getting this, and only half of my blocks are afected by the CB.

    16:47:33 [SEVERE] Could not pass event BLOCK_DAMAGE to ControllerBlock
        at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
        at java.util.ArrayList$ Source)
        at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.turnOn(
        at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.doRedstoneCheck(
        at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.doRedstoneCheck(
        at net.servfire.hellfire.bukkit.ControllerBlock.CBlock.editBlock(
        at net.servfire.hellfire.bukkit.ControllerBlock.BlockListener.onBlockDamage(
        at org.bukkit.plugin.RegisteredListener.callEvent(
        at org.bukkit.plugin.SimplePluginManager.callEvent(
        at org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDamageEvent(
        at net.minecraft.server.ItemInWorldManager.dig(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
        at net.minecraft.server.NetworkManager.a(
        at net.minecraft.server.NetServerHandler.a(
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(
  15. Offline


    This is the most amazing plugin I've ever used, it works perfectly for me, and I'm LOVING what it does. Thank you so much for taking the time to make the plugin and listen to everyone's complaints/ideas. You're awesome Hell_Fire, keep doing your thing
  16. Offline


    Running on latest CB reccomended build, I build my controller block as in the instructions, but when I power it it only toggle half the blocks I placed.
    I did finish editing properly, and I also tried re-adding the blocks it removed afterwards, but it still only toggles half of them, any suggestions? Or is this bugged atm?
  17. Offline


    When i out the block on the ground i cany make it work

    i right click it nothing and it fences

    and left click....

    but i still cant do it

    even a menssage dont appear

    "- 0 ControllerBlocks Loaded"
  18. Offline


  19. Offline


    nvm made it to work

    forgot to put redstone on top
  20. Offline


    Does this work with world edit? Say, u trigger the iron block with cobblestone, if you were to then replace a level of dirt with cobblestone, would those block now be controlled or do you have to manually lay the block?
  21. Offline


    Some fun we did with this (&FalseBook &MinecartMania)

  22. Offline


    Why can i dont make thies with signs ore painting
  23. Offline


    how can i cover large areas fast world edit doenst register it
  24. Offline


    just place one by one, the plugin will be listening for the event that governs player placing blocks. worldedit edits the blocks with no placement. besides, having a large amount of blocks switching on and off sounds like it might cause issues, especially since the current build isnt meant for craftbukkit 766
  25. Offline


    just wanted to thank you for this awesome plugin. We've been using it for months now and have build lots and lots of stuff with it. In the early morning i finished a new project which wouldnt have been possible without your plugin.



    Thanks :)
  26. Offline


    OMG, how long did THAT take?
  27. Offline


    Loving the Tower Bridge there :)

    Also, does anyone know if this plugin could cause inventory problems? I know it isn't for the latest version, but I am getting issues where I can't move anything around in my inventory, and it won't work until I restart both MC and the server together (one at a time and it persists). This only started after I began using this plugin. Thanks.
  28. Offline


    Just got a server crash with looping:
            at net.minecraft.server.World.applyPhysics(
            at net.minecraft.server.World.update(
            at net.minecraft.server.World.setData(
            at org.bukkit.craftbukkit.block.CraftBlock.setData(
            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.doPhysics(
            at net.minecraft.server.World.k(
            at net.minecraft.server.World.applyPhysics(
            at net.minecraft.server.World.update(
            at net.minecraft.server.World.setData(
            at org.bukkit.craftbukkit.block.CraftBlock.setData(
            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.doPhysics(
            at net.minecraft.server.World.k(
            at net.minecraft.server.World.applyPhysics(
  29. Offline


    Any chance of an update for this soon? It's now quite a few RBs behind.
    Also, I still have an issue where it won't toggle blocks on top of each other properly.
    As below, where the "o" are lapis blocks and the "x" is air space

    They're all linked up properly, it says added block 4/64 on the last one, they're in range, but after I toggle it once, it then only has half the blocks in the controller, and readding them doesn't fix it either.
  30. Offline


    I had to disable it, it was causing my server to start crashing like ever few minutes!
  31. Offline


    Its amazing how one of the simplest plugins is one of the best. :p

Share This Page