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

    Dashkal

    Chocwise: Are you trying to have a controller block control redstone current? I do that by controlling a redstone torch and using that to power other circuitry.
     
  3. Offline

    Whatever0815

    One of the best mods ever :)

    thx a lot!
     
  4. Offline

    PlatinSturm

    Yeah realy nice Plugin but why doesnt work Ids < 255, there are some blocks which can be used such as the sugar cane or the iron door!
    Would be nice if that would be fixed soon because i realy need it!
     
  5. Offline

    Hell_Fire

    It's mostly because I'd need to build a translation table between item IDs and the block IDs they actually place, it was quicker at the time to just check if it was a block with isBlock().

    A lot of items have metadata that also doesn't quite work out, I'm having that problem with ladders that don't work at the moment. Doors get even worse, because there's two blocks to manage. You don't go duplicating code in the core server, because the moment the server changes, you need to fix it. The idea of Bukkit as an API is you shouldn't need to update plugins every time there's a new server release, the API abstracts that away.
     
  6. Offline

    Chocwise

    Nah. That won't work for me.
    The current has to be conducted from a pressure plate downwards. Not with a torch attached to one of the 4 horizontal sides of the block with the pressure plate on it. And, as I see it, you can't do this with torches alone. :/
     
  7. Offline

    Hell_Fire

    Problem comes up because it's code I added to stop minecart tracks changing direction if controlled (also makes sure that when it's toggled, it stops the recalculating the track directions, so tracks toggle on/off proper).

    Will add an option that changes this, but things like minecart tracks might act weird :)
     
  8. Offline

    Chocwise

    That's perfectly fine with me. ;)

    Thanks again for your good work on this powerful plugin. There's so many things one can do with this thing. We love it on our server. :)
     
  9. Offline

    Hell_Fire

    Seems like various things that used to throw BLOCK_PHYSICS no longer do so, which is why torches duping (and my minecart track protection) are no longer working >.<
     
  10. Offline

    Omen

    any way to get redstone circuit added to the list of useable blocks?
     
  11. Offline

    Shenlong

    I have a small problem when I restart servers. I have a dual controller block setup that creates a hidden stairway going into a small room below my storage room for valuables. The top two block are alternately stairs or cobblestone depending on which controller block is on at the time. The problem is that any time I restart the server, when I bring it back up those two blocks are air. The rest of the setup is fine, just those two blocks that are controlled by both controller blocks are messed up. Is there any way to fix this?
     
  12. Offline

    pixartist

    This mod needs a way to spawn blocks that are not indestructible, and not bound to the controllerblock after they spawned
     
  13. Offline

    Dashkal

    pixartist: Have a close look at the config file. Do keep in mind that if protection is removed, what you effectively have is a block generator (duping galore).
     
  14. Offline

    Hell_Fire

    Hmmm, I think I know what's the cause of this, probably happens because by default it thinks the block is on, but when it's first loaded it never sets the blocks, so if it's in one state, it'll possibly mess up like that, if you toggle it, at least once, does it still do what you'd expect? If it's just a once off on loading thing, I might write an on chunk load handler to set those blocks up properly
     
  15. Offline

    Shenlong

    Yep, as soon as I hit the switch once after a restart it fixes it. Not a huge deal, I just usually don't remember to go hit the switch that once and only remember once I go into my storage room for something. If you could fix it though, that would be great :).
     
  16. Offline

    SneakyConman

    Is this broken for anyone else in the new Bukkit build? We use this plugin SO SO much on our server and would hate it to be dead. Its so useful :)

    Sorry I can't provide any information on the problem it just doesn't seem to work at all. Editing is broken and existing controller blocks do nothing.
     
  17. Offline

    rakiru

    Broken for us too. When the server starts up, there are lots of errors about not being able to load a certain world (the one stored in the file) and then you cannot edit or create blocks, as if it isn't loaded, but going from a fresh install (did so on my computer to test) seems to work fine.
     
  18. Offline

    Dashkal

    There are a lot of major breaks in recent Bukkit/CraftBukkit builds. Until plugins get a change to be rewritten with the api changes, you're probably best of staying with CB #556.
     
  19. Offline

    Hell_Fire

    I'll take a look at it, I think I've finished some other bits as well, so hopefully will have a new release out today
     
  20. Offline

    rakiru

    I'm running CB #556.
     
  21. Offline

    hyperch

    with #556, when using controllerblock, I can't login anymore.
     
  22. Offline

    Dashkal

    Sorry, misunderstood. In that case I have no idea :(
     
  23. Offline

    SneakyConman

    Thanks :) Really awesome plugin by the way. We have made all sorts of animated buildings (Even an animated dance floor) with it!
     
  24. Offline

    Hell_Fire

    Can't replicate this one, able to log in just fine with 556 :(

    Multiverse messes with the world ID, when updating the controllerblock.dat, you need to update controllerblock before installing multiverse. I'm testing with 556 and it seems fine?

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

    hyperch

    I just removed the ControllerBlock folder and and now I can login with #556
     
  26. Offline

    jmcneely

    Is there a way to find a control block that some one else place?
    The problem I am having is that one of my admins decided to be an ass and fill in another player's house with oby and we cant remove it cause its being controlled and I cant find the control block.
     
  27. Offline

    Hell_Fire

    >.< I've added a bit of a message to the "can't destroy, is a controlled block" message in my test version here, if you don't want to use it, look in the ControllerBlock.dat (is just a text file) and should be fairly easy to find the obsidian controllerblock line and its coords.

    I'm going to hold off releasing 1.16 just yet, still too many things like duping problems, and the next recommended build is going to be a doosy as far as compatibility goes from what I'm watching in the change log.

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

    rakiru

    We use Nether. They were both working fine together on the old build (CBlock then Nether), but after the update (everything updated at once), it now doesn't work. It doesn't even register hitting blocks. Is there a way to make the old dat work?
     
  29. Offline

    Hell_Fire

    Dump the contents of it on pastebin and I'll see what I can do
     
  30. Offline

    jmcneely

    Thank you so much, now I just need to deal with this player that decided to be an ass.
     
  31. Offline

    Chocwise

    I've tested your 1.16-testing build, but CB-controlled redstonewires still can't be powered. XD
    Have I missed something within the config file? I disabled every kind of protection (except edit-protection).
    If I'm not missing anything, because it's not yet implemented: Please don't forget me. ;)
     

Share This Page