[INACTIVE][MECH] FenceStack v1.11 - Place fences above other fences! [438]

Discussion in 'Inactive/Unsupported Plugins' started by recanu, Feb 15, 2011.

  1. Offline

    recanu

    FenceStack v1.11 (Build 438)

    You know this annoying problem when trying to make castle-like gates or poles with fences? First you have to make a dirt tower and then, one by one, remove on dirt block and replace it with a fence. This plugin allows you to place fences on fences like every other block!

    Features:

    • Allows you to place fences above and below fences!
    Download FenceStack (v1.12)
    Source (v1.11)

    Changelog
    Version 1.12
    • Fixed another item duping bug caused by an error.

    Version 1.11
    • Updated to work with newer bukkit builds (tested with 438)
    Version 1.1
    • Fixed incompatibility with ControllerBlock (Thanks to Hell_Fire)
    Version 1.02
    • Fixed placing fences when clicking blocks like Chests, Workbenches, Furnaces etc.
    Version 1.01
    • Fixed the item duping bug
    Version 1.0
    • First public release.
    Info:



    This plugin was made because of this topic.
    The plugin was tested with craftbukkit build 326. It may work with older versions, but this can lead to errors or other unwanted results. Please submit bugs & suggestions.
     
    TonyMcDanza likes this.
  2. Offline

    WMisiedjan

    Great! Love this, I always use the //wand tool in world-edit to do this, This is cool! Will try it out tonight.
     
  3. Offline

    Juze

    Awesome. Will download and test now. :)
     
  4. Offline

    Plague

    I'd really be interested in the source code as I cannot use a plugin without checking it from the inside, just too paranoid :)
     
  5. Offline

    Arisilde

    Genius. Installing tonight!
     
  6. Offline

    Juze

    Hmm, it duplicates fences. You just need two fences in order to get 50 fences. As you stack something on top of a fence, it doesn't remove the item from inventory but adds another fence -> Dupe.
     
  7. Offline

    Uniltiranyu

    :D tanks dude
     
  8. Offline

    riuthamus

    yeah, doesnt get rid of fences, need that to be able to use it!!
     
  9. Offline

    recanu

    Fixed it, sorry for this stupid bug :p
     
    riuthamus likes this.
  10. Offline

    riuthamus

    perfect, ill add it on our servers tonight!!
     
  11. Offline

    Waffletastic

    Only problem with this plugin I can see is that, when opening a chest or anything like it, with a fence inhand, a fence will be placed. Nothing too big but why not strive for a perfect plugin?
    --- merged: Feb 16, 2011 1:18 PM ---
    Only problem with this plugin I can see is that, when opening a chest or anything like it, with a fence inhand, a fence will be placed. Nothing too big but why not strive for a perfect plugin?
     
  12. Offline

    recanu

    Damnit, again an other stupid bug.. Anyways, fixed it with v1.02.

    @Plague Added the link to the source code in the description :)
     
  13. Offline

    Plague

    Thanks! Will test it. From the first look at the code, you can place it on water though.
     
  14. Offline

    recanu

    Water doesn't act as block nor lava does. And the event is only thrown when a block is right-clicked :)
     
  15. Offline

    DiddiZ

    Great!
     
  16. Offline

    Mitchell

    Add the ability to place torches on top of fences.
     
  17. Offline

    Hell_Fire

    @recanu: Nice :) Since this is working around a placed block, I've patched it to throw a BlockPlaceEvent so other mods can pick up on the block place (was specifically due to this post). I was adding a check on the BlockPlaceEvent to see if it was being cancelled to revert the block and refund the fence, but for whatever reason, trying to refund just one fence bit was causing it to refund 2? But not touching the items at all was making it not refund anything. Gonna put it down to a bukkit bug or something. Anyway, it was a small enhancement that doesn't really need to be added (since the block gets placed if it's canceled or not).
    To just throw the event, easy enough. Save the block state just before you setType on it, then callEvent with all the parameters, is almost copying everything out of your onBlockRightClick event.

    Edit: Fixed this now, took a look at how CraftBukkit does callEvent
    Code:
                if (b.getTypeId() == 0)
                {
                    BlockState oldState = b.getState();
                    b.setType(Material.FENCE);
    
                    BlockPlaceEvent placeEvent = new BlockPlaceEvent(Type.BLOCK_PLACED, b, oldState, ev.getBlock(), ev.getItemInHand(), ev.getPlayer(), true);
                    plugin.getServer().getPluginManager().callEvent(placeEvent);
    
                    if (placeEvent.isCancelled() || !placeEvent.canBuild())
                        b.setType(oldState.getType());
                    else
                    {
                        int am = ev.getItemInHand().getAmount();
                        if (am > 1)
                            ev.getItemInHand().setAmount(am - 1);
                        else
                            ev.getPlayer().getInventory().remove(ev.getItemInHand());
                    }
                }
    
    Modifed jar (source in jar) is here.

    (Oh, one thing to note, this doesn't check for the spawn protection area, not sure how to add that at the moment. Since in craftbukkit, in net/minecraft/server/ItemBlock.java:101 is where the spawn protection area is checked, and I don't know where WorldServer.D.spawnProtection is exported, if at all, in the Bukkit API.)

    Edit: Was thinking about it, and the if (placeEvent.isCancelled()) should probably be:
    if (placeEvent.isCancelled() || !placeEvent.canBuild())

    So the checks match like like craftbukkit does. I was ignoring the canBuild because the event is created just with true for canBuild, since that's where the spawnProtection check would go, but since mods can change that with setBuild(), it's not a static value. Changed the code block above anyway :)
     
  18. Offline

    Plague

    Oh I just posted that because you have lava in the source code...
     
  19. Offline

    recanu

    Thanks for your help! :) I included your code in v1.1 and spawnprotection. You can get the WorldServer from a CraftWorld.getHandle(). With that you can just use ((CraftWorld)world).getHandle().D.spawnProtection where world is equal to the current world. Check out the source :)

    Updated to v1.1:
    • Fixed incompatibility with ControllerBlock
     
  20. Offline

    Avous

    could we please get the ability to place a torch ontop of a fence post? it would be awesome!
     
  21. Offline

    amplifier

    Maybe you should make a complete controllable "Block Unleashed" mod to control the placeability of certain blocks on other ones.
    Like rails on glass, redstone on glass, torch on fence, sign on fence, etc.
    In short, make a mod where you can control what block you are able to place on certain blocks.
     
  22. Offline

    recanu

    Thanks for that great idea. :) I will try to include things like that in future releases.
     
  23. Offline

    Silvo

    This plugin is handy, thank you for your effort to make our minecraft experience even better.
    --- merged: Feb 23, 2011 9:41 AM ---
    patch 1.3 and craft bukkit 424 made the plugin uneffective .. doesn't work anymore :(
     
  24. Offline

    Avous

    works fine for me :) i have the latest everything and i can stack fences like a pro

    i just get a error on start up saying it works fine but it hates stupid long connectors i believe other than that she works great
     
  25. Offline

    Silvo

    oO ... whats is newer than pach 1.3 and cb version 424?? ... could it be that the plugin can't work because other non working plugins stoped the plugin load before FenceStack could get loaded? ....
    --- merged: Feb 23, 2011 9:48 AM ---
    well.. at least I know it works. ( puts the file back into the plugin folder )
    --- merged: Feb 24, 2011 1:40 AM ---
    nah.. can't get this to work. MC1.3/CB424. Also removed any plugin that were rporting ANY error in the server command prompth. I don't use any plugin that modifies block behavior at all. I'd like to know just how you make it work Avous.
     
  26. Offline

    recanu

    Released version 1.11. This should work with the newer bukkit builds (tested with 438).
     
  27. Offline

    SavageCore

    Another great plugin!
    I can keep placing fences ontop without them coming from my inventory so I guess the dupe bug has reappeared?
     
  28. Offline

    Netu

    Confirmed. Dupe bug has regretfully returned.
     
  29. Offline

    Phaedrus

    Very minor thing, but...

    2011-02-25 01:17:01 [WARNING] Using the stupidly long constructor com.recanu.FenceStack.FenceStack(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) is no longer recommended. Go nag the plugin author of FenceStack to remove it! (Nothing is broken, we just like to keep code clean.)
     
  30. Offline

    seriosbrad

    Still a dupe bug in 432, please fix, it's a great plugin.
     

Share This Page