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

    apokaliptik

    So I've tried running this plugins with no other plugins running with it, and I'm still getting the same bug. I do get the loading message on the console, but when I place the block and whack it with the material I wanna put, absolutely nothing happens! Any ideas ?
     
  3. Offline

    Cryoffun

    left clicking doesn't do anything, simply no response from the plugin
     
  4. Offline

    Hell_Fire

    What server versions? I've only tested it with 168 and 186.
     
  5. Offline

    shadydeath999

    btw it also works good on 166 :D
     
  6. Offline

    NekoSteamBoy

    Is there a way to change the kind of Block to use?
     
  7. Offline

    Mark

    Great plugin. Thankyou. I was hoping to use it for a castle gate built with fence 4 high x 8 wide but when I set it up and then activate the CB it only effects the last fence I placed. I'm not sure which version of craftbukkit I'm using but I updated it yesterday. I tried it a few times to make sure I didn't stuff up but the same thing happens each time.
     
  8. Offline

    Hell_Fire

    Hey guys

    Changed how I was handling updating minecart track metadata, now rather than listening to the physics event for metadata updates, I just kinda brute force over the adjacent blocks when you place a block for ones that need updating (doesn't take that long anyway, just doesn't look as nice codewise :p), seems to be more reliable than checking the BlockPhysicsEvent, since for some reason when certain track bits were getting changed, like from a flat track to angled, it was throwing an event with the block type in the ChangedType as AIR, so, I don't know what the hell is going on there, but it was causing my anti-dupe code to remove the track block from the controller. Ugh.

    UGH! Haha, that's my anti-dupe code kicking in, when you place the fence block on the other block, then remove the other block under it, the BlockPhysicsEvent is saying that it's changed type to AIR.

    This is really annoying, that event seems broken for just about any dynamic block. I'll just add a workaround in there that ignores it if it's a fence, since fences don't drop/collapse when you remove the block under it.
    --- merged: Feb 1, 2011 3:05 PM ---
    In your main folder the first time the mod runs, it should create a controllerblock.ini, change the IRON_BLOCK to whatever you like, use the Material name from:
    http://javadoc.lukegb.com/Bukkit/d7...bukkit.html#ab7fa290bb19b9a830362aa88028ec80a
    --- merged: Feb 1, 2011 3:36 PM ---
    Moving config and data into plugins/ControllerBlock where it should have gone in the first place (actually, it uses getDataFolder(), so if you've got a different --plugins set, it should go in the right folder), the mod will create the dir and move them automatically for you :)
    --- merged: Feb 1, 2011 3:56 PM ---
    And uploaded the new version, time to look into WorldGuard issues :)
    --- merged: Feb 1, 2011 4:19 PM ---
    Hrmmm, created region, set it's build flag to deny, deoped me so I can't modify anything in the region, and it still toggles okay :/ This is gonna be a pain to find out where the issue is
     
  9. Offline

    Jebuss

    I have problems that not every block added gets taken away when activated.
    It seems to not let me build more than 3 blocks away in any direction.
    I'm hitting the block with what I wish to build with. Then, when done hit it again and power it.
    I have minecart mania installed I know it adds to iron blocks properties could that be the issue?
     
  10. Offline

    NekoSteamBoy

    Hmm im using now almost 200 glowstones on 1 controller block working fine for me :/
     
  11. Offline

    Mark

    Thanx Hell_fire. I was going crazy thinking I'd stuffed up or maybe another plugin was messing with this one. I think we all forget sometimes Bukkit is unfinished and all the calls and hooks aren't implemented yet and you plugin developers build in work arounds to fix this when ya able to. Good job all of ya.
     
  12. Offline

    Cryoffun

    edit: I was using build 16..., didn't work, currently using and working on build 211

    could anyone link me the page where i can see previous builds?
     
  13. Offline

    NFFPokemon

    i get this when i hit the iron block with another block:

    02.feb.2011 17:33:59 org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event BLOCK_DAMAGED to ControllerBlock

    this also come up:
    02.feb.2011 17:34:03 org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event BLOCK_PHYSICS to ControllerBlock

    it also says this when i start :
    ControllerBlock: Using IRON_BLOCK (42) as ControllerBlock, loaded 0 disallowed types from config

    dont know if that is relevant

    ive tried with different builds of bukkit and dosent seem to work on any of them :(
     
  14. Offline

    Merlin_Q

    so... I was wonderring why doors cant be used...
    Is it due to the bugs with other dynamic objects?

    I was trying to make a working TARDIS (disappears and makes the sound)
    but I cant make the doors disappear :'(
    I even got a portal inside so that when you enter it takes you to *a bigger inside*
    ...
    now all I need is to be able to switch doors away.

    either way, thanks for the plugin, works great even in conjunction with many other mods.

    Merlin_Q
    North Pole, AK
     
  15. Offline

    Hell_Fire

    Ahh, that's because the door item doesn't count as a block, I'll look at it since, will probably need a special handler due to how doors are two blocks that act as one. (Technically you can use item id 64/71, but you only get the lower half of the door when placed, which makes me think I'll need to handle it differently)
    --- merged: Feb 3, 2011 2:12 AM ---
    I need the whole error including the stack trace under it to point where it's coming from. My test server runs 218 and seems to work fine.
     
  16. Offline

    NFFPokemon


    well thats pertty much what it says in the console, tho i get the feeling that its not the mods fault :/
     
  17. Offline

    SliMeY_G

    Hi,

    I can't see it in the changelog at all... has switching between two blocks (inversion) been implemented yet? e.g. When redstone current is off, block is cobblestone, when current is on block is glass?

    Thanks.
     
  18. Offline

    Nick Stevens

    First up, thank you! This plugin is some really nice work. :D

    I have a query/suggestion though; would it be possible to add a check to the plugin that looks to see if the blocks to be removed (toggled off) are actually still there? This way you would be able to store only the remaining blocks for the going forward and thus if a creeper, say, blows a hole out your hidden door only the remaining pieces will be toggled by your redstone mechanism.

    Edit: I just noted that you already have anti-dupe code, it just doesn't work well with dynamic blocks which I imagine a cactus block (being the block that made me think of this) probably is.
     
  19. Offline

    Hell_Fire

    Yeah, you can do this with two blocks, drop a torch on top of the one you want inverted and it'll do like it should (even with the redstone delay)
    --- merged: Feb 4, 2011 9:08 AM ---
    Hmmm, if explosions throw a BlockPhysicsEvent, then it should block dropping anything, if they don't, I probably need to intercept BlockExplodeEvent or something. Might make the config a little more detailed too, so you can pick if it denies dropping blocks at all, making whatever is controlled effectively invincible, or still does the drop, but removes it from the controllerblock.
     
  20. Offline

    Nick Stevens

    Ah it's because of the explosion then is it? Hmmm. Having the option of full on invincibilty for the blocks or removal from the controllerblock sounds fantastic, though! :D
     
  21. Offline

    Gorbachev

  22. Offline

    Hell_Fire

    That's awesome, I was thinking about doing a few animation like things the other night.
     
  23. Offline

    Arolathe

  24. Offline

    QQCucumber

    This plugin is broken on 264+ due to the world changes.
     
  25. Offline

    weirdbeard

    Thanks for a great plugin! I was gonna post about a minor issue I noticed with stairs: When I try to control the state of a row of stairs, some of the stairs are put back facing the wrong direction. Once the stairs have been flipped, they stay flipped and do not right themselves. (Have only tried with wooden stairs on b260 of CB.)

    However, it sounds like you have bigger fish to fry with the latest build according to the last post. :)

    Good luck and thanks again!
    -WB
     
  26. Offline

    Hell_Fire

    Yeah, I'll take a look at the stairs when I get a chance, my servers SATA card decided to drop a couple of drives on me today so I've been recovering from that. No data loss thankfully. Gonna grab the new build and find what's where now :)
    --- merged: Feb 7, 2011 9:53 AM ---
    And fixed, new version uploaded, there may be other changes in there, but I actually haven't worked on it the past couple of days, so if there was, I don't know what they were, but I'm pretty sure it's just the API update :)
     
  27. Offline

    Wernesgruner

    On build 332 everything works good except that every controllers are erased when the server restarts.
     
  28. Offline

    Hell_Fire

    332? last build I see was 270, if you ment 232 though, then yes, it won't load it properly with this version, as per the changelog (hence why I bumped the minimum version up to 265, which is when the change happened).

    There's a link to 1.04 in the ChangeLog if you're still running versions prior to that.
     
  29. Offline

    Wernesgruner

    You are right! It worked perfectly after i updated both bukkit and Controller block.

    Thank you !
     
  30. Offline

    Hell_Fire

    I'll take a better look at it once I've got my server fixed up, is a pain in the butt waiting for RAIDs to rebuild, hehe.
     
  31. Offline

    Wernesgruner

    Works good finally. It was a permission problem minecraft daemon was read only in ./pugins/ControllerBlock
     

Share This Page