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

    Hell_Fire

    If anything, it should be BlockPhysicsProtectMode, set that to none and see if that does it. I haven't had a close look at it, will do soon.
     
  3. Offline

    Chocwise

    No. It doesn't. ;)

    [​IMG]

    The first three wireblocks are not CB-controlled. The last three are controlled.
     
  4. Offline

    Kevin Forte

    Is this going to be updated for 600+ soon? This is one of my favorite plugins ):
     
  5. Offline

    nanashiRei

    I double that :)
     
  6. Offline

    Hell_Fire

    Getting errors on the #602 recommended build, am working on fixing now :)
     
  7. Offline

    Kevin Forte

    Awesome :D
     
  8. Offline

    Hell_Fire

    Done ^^ 1.16 up, fixed for #602 (and requires #602 for the API changes) Find bugs! No doubt I've missed stuff
     
  9. Offline

    Quaffle

    Is using #602
    starts up with message

    Code:
    15:45:20 [INFO] ControllerBlock: 1.16 by Hell_Fire
    
    15:45:20 [INFO] ControllerBlock: Using IRON_BLOCK (42) as ControllerBlock, loade
    d 0 disallowed types from config
    15:45:20 [SEVERE] BLOCK_DAMAGE loading ControllerBlock v1.16 (Is it up to date?)
    java.lang.NoSuchFieldError: BLOCK_DAMAGE
            at net.servfire.hellfire.bukkit.ControllerBlock.ControllerBlock.onEnable
    (ControllerBlock.java:58)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:414)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:187)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Any help?
     
  10. Offline

    Hell_Fire

    Are you sure you're using #602? That error would suggest you're still using an older craftbukkit build
     
  11. Offline

    Quaffle

    Oh, some reason my plugin that updates Bukkit said it updated to #602, but didn't. Redownloaded #602 and works great!
    Sorry for inconvenience.
     
  12. Offline

    Chocwise

    @ Hell_Fire:
    "added some config options" sounds very good to me. :D
    I'll update CraftBukkit (and lots of Plugins XD) on the weekend. I'll try your 1.16-build then. ;)

    Thanks for your hard work again. :)
     
  13. Offline

    Killerrabbit

    Anyone have this to work in 1.4? Atleast for me it wont work :( Guess I have to wait for update
     
  14. Offline

    xAsparagus

    Dosent work for me, im placing an iron block, putting redstone ontop, left clicking on the iron with a dirt block and nothen happens after that? wat am i doing wrong??
     
  15. Offline

    adamtaz

    same here all my buildings dont work and now we have bedrock lockers placed with no way of getting in them....
     
  16. Offline

    Hell_Fire

    Check for mod conflicts, I've tested against build 617 and it's fine
     
  17. Offline

    fireb33

    Hell_Fire, is there a way to prevent duplicating items like torches, rails, etc.?
     
  18. Offline

    rakiru

    http://pastebin.com/AeKKBKcN
    Thanks. I tried replacing the numbers with world and netherworld like the new dat does, but that didn't work.
     
  19. Offline

    Hell_Fire

    Hrmm, that's all I'd be doing.. odd that it isn't working :/ Here's my attempt anyway: http://pastebin.com/73jSCEU2

    It used to block those items duplicating, for now though, add them to the disallowed list in the config. I haven't found the event to cancel for those objects getting acted upon (used to throw BLOCK_PHYSICS, but it doesn't anymore :/)

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

    fireb33

    Maybe I found the issue:

    Here's my config:
    Code:
    # ControllerBlock configuration file
    
    # Blank lines and lines starting with # are ignored
    # Material names can be found: http://javadoc.lukegb.com/Bukkit/d7/dd9/namespaceorg_1_1bukkit.html#ab7fa290bb19b9a830362aa88028ec80a
    
    [general]
    
    # ControllerBlockType is the material allowed of new ControllerBlocks
    # Doesn't affect already assigned ControllerBlocks
    ControllerBlockType=IRON_BLOCK
    
    # QuickRedstoneCheck to false enables per-tick per-controllerblock isBlockPowered() checks
    # This is potentially laggier, but blocks can be powered like regular redstone blocks
    # If set to true, wire needs to be run on top of the controller block
    QuickRedstoneCheck=false
    
    # BlockProtectMode changes how we handle destroying controlled blocks
    # It has 3 modes:
    # protect - default, tries to prevent controlled blocks from being destroyed
    # remove - removes controlled blocks from controller if destroyed
    # none - don't do anything, this effectively makes controlled blocks dupable
    BlockProtectMode=protect
    
    # BlockPhysicsProtectMode changes how we handle changes against controlled blocks
    # It has 3 modes:
    # protect - default, stops physics interactions with controlled blocks
    # remove - removes controlled blocks from controller if changed
    # none - don't do anything, could have issues with some blocks
    BlockPhysicsProtectMode=remove
    
    # BlockFlowProtectMode changes how we handle water/lava flowing against controlled blocks
    # It has 3 modes:
    # protect - default, tries to prevent controlled blocks from being interacted
    # remove - removes controlled blocks from controller if flow event on it
    # none - don't do anything, things that drop when flowed over can be dupable
    BlockFlowProtectMode=remove
    
    # DisableEditDupeProtection set to true disables all the checks for changes while in
    # edit mode, this will make sure blocks placed in a spot will always be in that spot
    # even if they get removed by some kind of physics/flow event in the meantime
    DisableEditDupeProtection=false
    
    # MaxDistanceFromController sets how far away controlled blocks are allowed
    # to be attached and controlled to a controller block - 0 for infinte/across worlds
    MaxDistanceFromController=0
    
    # MaxControlledBlocksPerController sets how many blocks are allowed to be attached
    # to a single controller block - 0 for infinite
    MaxBlocksPerController=0
    
    # Nijikokun Permissions support
    # The nodes for permissions are:
    # controllerblock.admin - user isn't restricted by block counts or distance, able to
    #                         create/modify/destroy other users controllerblocks
    # controllerblock.create - user is allowed to setup controllerblocks
    # controllerblock.modifyOther - user is allowed to modify other users controllerblocks
    # controllerblock.destroyOther - user is allowed to destroy other users controllerblocks
    #
    # DisableNijikokunPermissions will disable any lookups against Permissions if you
    # do have it installed, but want to disable this plugins use of it anyway
    # Note: You don't have to do this, the plugin isn't dependant on Permissions
    DisableNijikokunPermissions=false
    
    # Users listed in ops.txt (op through server console) counts as an admin
    ServerOpIsAdmin=true
    
    # Everyone on the server can create new ControllerBlocks
    AnyoneCanCreate=true
    
    # Everyone can modify everyone elses ControllerBlocks
    AnyoneCanModifyOther=true
    
    # Everyone can destroy everyone elses ControllerBlocks
    AnyoneCanDestroyOther=true
     
    [adminPlayers]
    # One name per line, users listed here are admins, and can
    # create/modify/destroy all ControllerBlocks on the server
    # Block restrictions don't apply to admins
    
    [disallowed]
    # Add disallowed blocks here, one Material per line.
    # Item IDs higher than 255 are excluded automatically due to failing Material.isBlock() check
    #RED_ROSE
    #YELLOW_FLOWER
    #RED_MUSHROOM
    #BROWN_MUSHROOM
    
    
    I set "BlockFlowProtectMode" and "BlockPhysicsProtectMode" to "remove", but EVERY time I restart server, plugin recreates them at the end of config file, with "protect" parameter, so there are multiple entries with different parameters.
     
  21. Offline

    Hell_Fire

    Ack, thanks for the report and the hunting! I'll fix this up right away and release a new version, since this cluttering config files is a really bad thing >.<

    New version up, fixed that, thanks :)

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

    fireb33

    Oh, thanks for your wonderful plugin :D

    Just tried, it works flawlessly! No more duplication ^^
     
  23. Offline

    mbsuperstar1

    I have an issue with sand duplication at the moment, and its quite complex to explain.
    Firstly I made a wall out of stone 5 wide, 1 thick and 5 up.
    Then I placed a ledge on the 4th row up, and made a controller block nearby and power it and attached a lever.
    Next I used SAND on the controllerblock and placed it on the ledge, pulled the lever so it disappeared and removed the ledge.
    At this point you could repeatedly turn the controllerblock on and off to receive 4x as much sand, on a small scale..

    Am I doing it wrong? :eek:

    EDIT: Due to the sand not falling during the editing, it doesn't recognize it will fall when the ledge is removed.
     
  24. Offline

    tha d0ctor

    Could there be a function that creates an iron block/whatever item at the config coordinates in the world if one doesn't already exist there. I had a chunk disappear in my world and the blocks are still in the configs but not visible and it'll be quite hard trying to guess each block in the very large area :/

    Thanks! I can't thank you enough for the plugin!
     
  25. Offline

    mrgreaper

    if you press f3 it will display amoung many things your exact x y z coords updated as you move about, should help you locate waylaid ironblocks
     
  26. Offline

    zumbach242

    Very pointless, but fun plugin! (You may want to change your title ([MECH] ControllerBlock v1.17 - Toggle blocks on/off with redstone [602] to [MECH] ControllerBlock v1.17 - Toggle blocks on/off with redstone [617]))
     
  27. Offline

    tha d0ctor

    thanks I aprreciate the help!
     
  28. Offline

    fireb33

    Ok, after testing it, I can say that duplication is still here, even with BlockPhysicsProtectMode=remove

    I tried all settings combinations, but no way.... :(
     
  29. Offline

    Hell_Fire

    Check that you actually got 1.17, occasionally browsers cache the old version :/ The version is in the loading message when the server starts up.

    Also, certain things got changed to not have the BLOCK_PHYSICS event thrown for them anymore, torches and whatnot, noones responded to me as to if there's another event or anything to cancel these, so the protection is pretty limited :/
     
  30. Offline

    fireb33

    sure, 1.17 with CB617...

    Do you confirm it's working?
     
  31. Offline

    Hell_Fire

    Yeah, except for torches, cactus seems to stay put, but toggling at least the redstone torch causes a drop, :/ Could be a bug in craftbukkit... (Edit, ugh, sand isn't getting cancelled either :/)
     

Share This Page