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


    You probably have an empty line somewhere in your save file, if you went modifying it, the only lines you should have are the "# v3" line at the top, and data CSV lines below it. There shouldn't be any empty lines in that file at all. (Empty lines are checked for in 1.11, but the error checking is very basic, attach your .dat and I'll see if I can fix it up for you)
    --- merged: Feb 22, 2011 7:33 AM ---
    I'm replying to Demon Boy
  3. Offline


    having a bit of trouble with that i tryed uploading using the bukkit thing but it cant grab the .dat file type even when i use all file types

    so i included this link
    --- merged: Feb 22, 2011 7:41 AM ---
    also a basic question about your plugin is it possible to using redstone wires to have more then 1 controler hooked up to 1 lever

    ive tryed many times it just fails but only works for the first one in the chain
  4. Offline


    Do you get any errors when the plugin loads your .dat? I'm not able to reproduce the error when the WorldID is changed to match my servers world, but gave me a NullPointerException when I loaded an unmodified version of yours (if your WorldID got changed somehow, it might be what's causing your issues).

    Also, yeah, you can, if you've turned the QuickRedstoneCheck off, you need to be real careful about the redstone wiring into the blocks, as they'll be just as picky as regular redstone circuits. If you wire them all up from the top, you shouldn't have any issues.
  5. Offline


    The only error your plugin produces is when i tryn to finish editing. Nothing else!=
  6. Offline

    Demon Boy

    yeah idk when controllers on permissions is off and vise versa..
    --- merged: Feb 22, 2011 8:30 AM ---
    weird i take away permissions and controllers are even less responsive...
  7. Offline


    Permissions can only grant extra abilities to players as far as my mod goes, and even then, only if you disable things in the ControllerBlock.ini. I'll add a "clean" .ini to the first post in a spoiler block or something so you can get the options if you don't have them.
  8. Offline

    Demon Boy

    shouldnt the defult files work fine though? cause ive re installed it several times its not working :,(
  9. Offline


    By default, everyone has permissions to modify anyones blocks, for as many blocks and as far as they like. If it's not working, look for block protection mods or something that will cancel out the events, you need permissions on those mods as well (for interacting with the world, building, etc are common protections that will interfere with this mod)
  10. Offline

    Demon Boy

    i havent installed anything like that yet
    --- merged: Feb 22, 2011 8:59 AM ---
    this is whats in my .dat file

    # v3

    thedevilschild being me
  11. Offline


    Yeh, that's a normal .dat for a controller block without any toggle blocks assigned to it, dunno, maybe there's been a change to the API I need to fix up for, will take a look at it after I've had some sleep, as it is now, I'm useless for coding :p
  12. Offline

    Demon Boy

    k i might do a little more fiddling
  13. Offline


    First: I didn't read the whole thread, so I don't know whether it is already reported:

    If you destroy a Controller-Block via TNT the entry in the .dat-file is not removed and you cannot destroy the controlled blocks either. After stopping the server and removing the entries with a text-editor everything was fine.
  14. Offline


    If that happens you can replace the space where the controller block used to be with any other kind of material, and it should work as intended when you destroy the replacement block. It used to work like that, not sure if it still does though... I don't have a habit of removing controller blocks via TNT. :/

  15. Offline


    Ah, okay, thanks :)
  16. Offline


    this is my favorite mod. thank you so much for bringing it over! [​IMG][​IMG][​IMG]
  17. Offline



    I updated to the latest CraftBukkit (423 at this time), and ControllerBlock does not work properly. It works as it is supposed to, but when you close/restart the server, its gone again. Just thought I'd let you know.

    Your Friendly Neighborhood Egg
  18. Offline


    I'm not having issues with it, but I have not tried to add any new ControllerBlocks... all of the pre-existing ones still work though. It could be something to do with new CB's being placed.

  19. Offline


    Nope, not the problem. As soon as I converted my save file, I tried to toggle my blocks, and they didn't work. The redstone was fine and all, they just don't work
  20. Offline


    issue ... (MC1.3/CB420)

    The controller block functions as it muss but stopping the server ( even while registered blocks are visible and redstones non-powered) results at unfunctionality. Activated the lever and powering the controller block simply does nothing and you have to re-do the complete desired ingame controller block setup which is "forgotten" again as the server stops/restarts.
    --- merged: Feb 23, 2011 8:57 AM ---
    upgrading to #424 didn't help
  21. Offline


    When thinking about it, it would maybe be too much of a hassle using redstone. maybe another idea is to allow only goldblocks to be controlled. (but if you hit them while editing they will transform into the block in your hand.) that way you will atleast have to pay gold, an otherwise useless resource.

    Another thing I noticed is that you cant add lava/water sources to be controlled. I guess its because they change size (id ?) as the lava/water expands. if you edit yourself some "still lava / water" it works as long as its by itself.
  22. Offline


    do you update your mod for beta 1.3?
  23. Offline


    on #432 i get this warning:

  24. Offline


    That'd be because the buckets holding water/lava don't count as blocks, I'd need to write a special handler to get them to be picked up. You can still control them by using other less expensive blocks as floodgates to them, will add it to the known bugs list though :) (Liking the gold block idea, will make it as an option, also thought of adding optional iConomy support too)

    I'll be updating for 419+ when I get home from RL work :) Those having save issues, in your plugins/ControllerBlock folder, do you get a ControllerBlock.dat.tmp file getting left about? What OS are you using?

    I recently changed the save code to write to a temporary file, then move it over the live file. It's safer than writing over the live file directly because of possible errors during writing (losing new changes beats losing ALL the data), but seems like it's causing some issues :/
  25. Offline


    Yes, if you add the option for Gold Blocks, please make it an option, as currently we have uses for Gold Blocks on our server.... minecart boosters! Anyone using Minecart Mania will be "disappoint" if Gold Blocks are needed to "pay" for Controller Blocks :/

  26. Offline


    I don't really like the idea of having to 'buy' the controlled blocks, especially since this is mostlikely mainly used on Creative SMP servers...

    And, a fix for the new revs of Bukkit would be nice. Thanks, dude :)
  27. Offline


    Quote my post when you update for CB #432 so I get an alert and can update please. Awesome plugin btw!
  28. Offline


    Any of these features I add will be configurable options defaulting to how the mod was originally. Optional extras for those who want to enable them :)
    --- merged: Feb 24, 2011 5:16 AM ---
    Hey, minecart mania user here too :) As mentioned, it'll be an option if I get around to it, defaulting to off :)
    --- merged: Feb 24, 2011 5:17 AM ---
    And if I can even log in, I'm affected by the new launcher/update unable to connect errors, ugh >.<
  29. Offline


    Sweet as :)

  30. Offline


    how about making a config whether to pay at all or whether to pay with silver or gold block?

    if empty, no pay required
    if set to gold, then gold block required
    if set to silver, then silver block required

    That way you can have minecart gold booster and still a pay system :)
  31. Offline


    Do you mean Iron?

Share This Page