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

    ShadowDrakken

    it's working for me on the latest recommended build (440)
     
  3. Offline

    grinch843

    If possible, this would be a great option!!!!!!
     
  4. Offline

    Omen

    quoted for happiness if this is implmented
     
  5. Offline

    Orangenpresse

    Here is my console:
    Code:
    CONSOLE: ControllerBlock: 1.12 by Hell_Fire
    CONSOLE: ControllerBlock: Using protect block protection mode
    CONSOLE: ControllerBlock: Using IRON_BLOCK (42) as ControllerBlock, loaded 0 disallowed types from config
    CONSOLE: ControllerBlock: Loaded v3 data - 4 ControllerBlocks loaded
    CONSOLE: ControllerBlock: Enabling quick redstone check
    CONSOLE: ControllerBlock: Events registered
    Permissions: version [2.1] (Handler) loaded
    Authorization: 3 user registrations loaded
    Authorization: Authorization plugin build 14 is enabled
    MultiVerse: Permissions Found
    MultiVerse: - Version 1.4 (Permissions 2.1) Enabled
    MultiVerse: Loading World & Settings - 'Mond' - NETHER
    MultiVerse: Loading World & Settings - 'Erde' - NORMAL
    MultiVerse: Loading World & Settings - 'Pandora' - NORMAL
    MultiVerse: 3 - World(s) loaded.
    'Erde' is my mainworld, and if I build a controllerblock in my second world 'Pandora' the block doesn't load my changes after restarting the server. So if I try to edit the block in 'Pandora' (after restart) there's no message 'finish editing controllerblock' like on 'Erde'.

    Maybe MultiVerse needs to be loaded first?
     
  6. Offline

    TGGeko

    The anti-dupe code is terribly broken. I was building a large structure out of cobblestone, and literally 20% of them were removed, all totally at random. It's very frustrating.
     
  7. Offline

    Hell_Fire

    How large? Possibly large enough that the chunks the blocks were placed got unloaded? I'm working on a theory that Location objects have a rather specific validity to being inside a loaded chunk, and when the chunk gets unloaded, the Location objects associated with those disappear.

    I haven't built anything big/long enough to unload blocks that far away, maybe it's time I did, lol
    --- merged: Feb 27, 2011 8:42 AM ---
    I'd say so, the location objects won't be able to find the world before that I guess. Hrm... will try and think of some way to work around that. I'm thinking a lot of these location kind of problems are related. *sighs*
     
  8. Offline

    Wernesgruner

    I still get absolutely no reaction when i hit the controller block. Here are the other plugins I use :
    Towny, Essentials, RestoneChips,WorldGuard,GroupManager,FenceStack, MCDocs, Iconomy.

    I'm not quite sure what causes that, I have no errors in the console, I use the recommended build and the DIAMOND_BLOCK.

    I get absolutely NO reactions from the blocks.

    Thank you very much.
     
  9. Offline

    Wolfpack1221

    I absolutely love this addon.
    However I am having a problem with it, the anti-dupe code is freaking out on just about everything I try to edit.

    In the first example i was making an access panel for my door mechanisms (also made with controller block and work perfect). After finishing filling in the floor this is what did not stick. Throughout the process i was being spammed with "Removing block due to changed type while editing"
    [​IMG]


    While wiring up a control room I accidentally started editing one of my controller blocks, 10 blocks were removed before i could figure out which block i was editing.
    [​IMG]

    Perhaps is it possible to put an option in the config to disable this protection thing? (Im not 100% sure what its for in the first place so I don't know if that's even feasible )
     
    TGGeko likes this.
  10. Offline

    THEK

    Forgive me if I have missed something. Can you replace blocks with other blocks using 1 ControllerBlock?
     
  11. Offline

    ShadowDrakken

    do you have a redstone wire on top of your controllerblock? that was made a requirement recently
     
  12. Offline

    Dawodo

    Is this fixed for the latest builds yet? I think there was some change about the onBreak or onDamage Handler - LWC didnt work properly because of this. So is ControllerBlock uptodate?
     
  13. Offline

    ShadowDrakken

    it's working on the current Bukkit team's recommended build 440
     
  14. Offline

    t3rminat0r

    I get the block to start registering the blocks but as soon as i hit the block again to stop it editing this is what i get running bukkit ver 440
    Code:
    2011-02-27 16:42:14 [INFO] This server is running Craftbukkit version git-Bukkit
    -0.0.0-458-g557f3d2-b440jnks (MC: 1.3)
    Code:
    [SEVERE] Could not pass event BLOCK_DAMAGED to ControllerBlock
    java.lang.NullPointerException
            at com.hell_fire.bukkit.ControllerBlock.CBlock.loc2str(CBlock.java:306)
            at com.hell_fire.bukkit.ControllerBlock.CBlock.serialize(CBlock.java:257
    )
            at com.hell_fire.bukkit.ControllerBlock.ControllerBlock.saveData(Control
    lerBlock.java:181)
            at com.hell_fire.bukkit.ControllerBlock.CBlock.editBlock(CBlock.java:138
    )
            at com.hell_fire.bukkit.ControllerBlock.BlockListener.onBlockDamage(Bloc
    kListener.java:128)
            at org.bukkit.plugin.java.JavaPluginLoader$23.execute(JavaPluginLoader.j
    ava:242)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:225)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:346)
            at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:253)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     
  15. Offline

    TGGeko

    No, the structure was definitely smaller than the chunk. This happens for no apparent reason, I tried it with sand, cobblestone, and even torches, and they all just spontaneously remove themselves. As mentioned above, the option to remove the anti-dupe procedure would be much welcomed. I promise not to abuse it [​IMG]. I don't even know how I would.
     
  16. Offline

    Hell_Fire

    Ahh, I'd prefer not to disable it, but you've shown me something very very important with this screenshot! It'll be detecting dirt turning to grass, and grass turning to dirt as a changed type, which the anti-dupe code kicks in on. I'll fix this up :)
    --- merged: Feb 28, 2011 12:51 PM ---
    Sorry I haven't been active the past couple of days, I lost a 1.5TB drive and a 16 port SATA controller over the weekend and have been trying to cobble together a working server again.
    --- merged: Feb 28, 2011 12:52 PM ---
    Will make the anti-dupe stuff an option too. :)
    --- merged: Feb 28, 2011 12:57 PM ---
    Sand will cause it, gravel too, ugh, torches actually have two types of torch which represent the same valid block, I can fix that one up. Cobblestone is a little strange, not entirely sure why that's disappearing. Dirt/grass will do it, am gonna fix that one up too.
    --- merged: Feb 28, 2011 12:57 PM ---
    I'll take a look at it, thanks for the heads up.
     
  17. Offline

    Moetrix

    I love this plugin, it gives such a creative effect. I get all emo when i play singplayer... lol
    But i was wondering..
    Would it be (or is it already) possible to make the controller block switch between 2 types of blocks?
    Lets say you have 2x2 blocks of sandstone, when you trigger the controllerblock the 2x2 sandstone turns into fx. cobblestone.
     
  18. Offline

    Hell_Fire

    Think more creatively ;) Using two ControllerBlocks, one of which with a torch on top of it, or otherwise inverted redstone wise will give you the effect you're after. The reason why I don't implement this directly into the mod is it adds a lot more complexity inventory handling wise, and is a bit of a downgrade, with how the mod is already, you can toggle a single location between several block types by powering the respective ControllerBlock :)
     
  19. Offline

    ark3typ3

    I noticed that happens with creepers a lot too, if the creeper blows up the block, the reference is still there, but the block is not. The fix I found was to place any arbitrary block there (didn't seem to matter what) to act as a surrogate controller block and then destroy it which allowed the stuff to refund.
     
  20. Offline

    Hell_Fire

    Yeah, that's the workaround to unexpected block mishaps, someone mentioned blowing it up with TNT as well, same workaround, hehe >.< Not too sure what to do with that one, probably make it an option like the BlockProtectMode.
    --- merged: Feb 28, 2011 5:16 PM ---
    Whoa, 9K jump, must have made some changes.

    1.13 is up

    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.

    That's all I can think of for now, yes, it does appear to work just fine, at least on #467. Have fun :)
     
  21. Offline

    Flenix

    Any chance you can add support for reeds/sugar cane? I know its technically not a block, but I'm trying to design a method of farming with the flick of a switch using a few mods.

    I've got it to the point so far where I flick a switch and the grown reeds on my roof end up locked up in a chest in my basement, but then I have to manually replant the reeds - thats what I want fix now :p
     
  22. Offline

    audhen

    Everything fine now :)
     
  23. Offline

    Slice

    Ladders are invisible,
    also is it possible to edit the in-game text?
     
  24. Offline

    ettore85a

    I have found 2 Glitch in this Plugin: (sorry 4 my english.. i'm italian)
    Used Bukkit version 478 - version of plugin 1.13

    1 - If you create a wall, and use Torch with controllblock. Then destroy the wall. If you switch on the controller block all torch drop in the floor, switch off controll block.. again switch on controller block and... all toch drop in the floor AGAIN!!! you can have INFINITE TORCH (BlockProtectMode=remove).

    2 - I have placed in the floor 1 block of diamond, i use a TNT for destroy it.. drop and take... and... switch off controll block... switch on controll block.. and appared again!!! (BlockProtectMode=remove).

    please fix this bug :D

    thank you and so sorry for my very bad english...

    Ettore
     
  25. Offline

    Rick Boss

    @ettore85a always love to see people trying, rather than throwing their hands up and giving up completely!
     
  26. Offline

    halomastercap

    This is, by far, my favorite plugin. Even more than warp, home, spawn, and group control. I freaking love this thing.

    So far the only problems we've run into are:

    1. State change removing for lava (water?). Even if you place the lava into a sealed square where it cannot flow I guess it goes through a quick state change as it registers that, removing it from the controller block. :(

    2. If you destroy a controller block without "Finishing editing" it can interfere with creating new controller blocks. So far whenever we've accidentally done this we have to go edit a different block to regain our control. Can get confusing when it is 3 AM and you're not sure what happened...lol
     
  27. Offline

    Andred

    I love this plugin! Problem though in recent craftbukkit builds: I can start editing a controller block, but when I try to stop editing it, I get a console error because bukkit can't pass the BLOCK_DAMAGED event to the plugin. Actually, here's the error:

    Code:
    23:47:08 [SEVERE] Could not pass event BLOCK_DAMAGED to ControllerBlock
    java.lang.NullPointerException
            at com.hell_fire.bukkit.ControllerBlock.CBlock.loc2str(CBlock.java:306)
            at com.hell_fire.bukkit.ControllerBlock.CBlock.serialize(CBlock.java:257)
            at com.hell_fire.bukkit.ControllerBlock.ControllerBlock.saveData(ControllerBlock.java:181)
            at com.hell_fire.bukkit.ControllerBlock.CBlock.editBlock(CBlock.java:138)
            at com.hell_fire.bukkit.ControllerBlock.BlockListener.onBlockDamage(BlockListener.java:128)
            at org.bukkit.plugin.java.JavaPluginLoader$22.execute(JavaPluginLoader.java:232)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:225)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:357)
            at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
     
  28. Offline

    Hell_Fire

    Understood you perfectly, your English is a lot better than most native speakers :)
    --- merged: Mar 1, 2011 6:44 AM ---
    I added an extra error message to that function in 1.13, is there anything before the NullPointerException message?
    --- merged: Mar 1, 2011 6:51 AM ---
    Yeah, directly controlling liquids has a lot of known issues (Is actually in the first post). Is needing work with that, actually might be an easyish fix for it soon since I added some extra checks for some other issues that were occurring too.

    For number 2, I thought I fixed this bug a while back >.< Guess I'll add a check to the creation thing as well, hrmm..
     
  29. Offline

    Fyren

    Hi.

    Ever since the last update, I'm experiencing the following issue:

    When I set up a Controller Block, and then destroy it, the blocks I set with it are not destroyed and spawned upon its destruction. Instead they either still sit were I placed them, and trying to get rid of them gives me the "Controlled by another Block" message, or the place were I put them is empty (because the Controller Block was on) and setting up another block there of whatever material I used will be added to the now destroyed Controller Block.

    Any idea whats going on?
     
  30. Offline

    TheDaddyPeanut

    Im having a question for one of the vids.
    Its about hidden staircase/entrance (by narrowtux)

    I wanna use this one for my castle bride, it should appear when walking over an pressure plate, and stops after walking over a pressure plate. But the problem is, that i dont know how to build it, and i wanna know if it works in two directions, so i can walk over the bridge and back.

    1. How to build the system?

    2. Does it work in 2 directions, so not only in but also out/back?

    Idk maybe you dont know it at all but i'd just give it a try ;)
     
  31. Offline

    Andred

    No, there was no other error message attached to the exception.
     

Share This Page