No blocks on top of chests

Discussion in 'Archived: Plugin Requests' started by Deathfromace, Sep 17, 2012.

  1. Offline

    Deathfromace

    There are many ways to protect chests but sadly not many ways to make it where chests are no protected. I used to own a server where factions was the guild plugin and even with chest protection off people could just place a block on top of their chest and it was protected.

    I just want a simple plugin that makes it where nothing can be placed on top of a chest.

    Edit: I did more searching and found another request http://forums.bukkit.org/threads/factions-addon-mech.85731/#post-1211638 but while some guy said there was already a plugin he didnt post the name.
     
  2. Offline

    SpartaMercenary

    You ordered it, I'll cook it up. :p

    Edit: <Edit by Moderator: Redacted mediafire url>

    Edit 2: Forgot to say, the permission node "nochestblock.place" allows players to place blocks above chests. Ops have this by default.
     
    Last edited by a moderator: Nov 9, 2016
  3. Offline

    Deathfromace

    Well that was really fast. I'll test it out and see how it goes.

    Edit: And it works thank you
     
  4. Offline

    SpartaMercenary

    Yeah, 41 line plugins are usually that fast.
     
  5. Offline

    Deathfromace

    SpartaMercenary

    Well thank you for the plugin it works perfectly and this will solve the issue where you can have land protected without having to also have chests protected.
     
  6. Offline

    SpartaMercenary

    No problem.
     
  7. Offline

    Deathfromace

    @SpartaMercenary

    Sadly a player on my server found a loophole in this by letting sand fall on the chest. Is it possible to give chests the property of another item? If so making it have w/e makes sand break when falling on a torch would be awesome.

    For your previous and hopefully ongoing help I will donate to you for this if you want to PM me your paypal info.

    Also I suggest throwing this up on bukkitdev as I'm fairly sure others need this plugin even if they don't know they want it yet as I can't imagine I'm the only one that does not want protected chests but does want land protection.

    Thank you
     
  8. Offline

    Muddr

    This will stop them from placing a block above a chest, dropping sand or gravel on it, and stop a piston from pushing a block on top of the chest. :D
    Code:
    @EventHandler
    public void BlockPhysicsEvent(BlockPhysicsEvent event) {
        Block block = event.getBlock();
        Material mat = event.getChangedType();
       
        if (block.getType() == Material.CHEST) {
            Block blockAbove = block.getRelative(BlockFace.UP);
            if (blockAbove.getType() == mat) {
                blockAbove.setType(Material.AIR);
            }
        }       
    }
     
  9. Offline

    Deathfromace

    Thank you for that but I am not entirely sure how to edit the code to play that in it :D
     
  10. Offline

    np98765

    I shall compile that for you in a little bit. :3 (Give me an hour or two, I have some stuff I need to do first)
     
  11. Offline

    Muddr

    I could have done it.. just figured since @SpartaMercenary started it. I was gonna let him implement it.
     
  12. Offline

    np98765

    Deathfromace

    Fresh from the oven, <Edit by Moderator: Redacted mediafire url>
     
    Last edited by a moderator: Nov 9, 2016
  13. Offline

    Deathfromace

    [quote uid=17954 name="np98765" post=1350230]Deathfromace

    Fresh from the oven, <Edit by Moderator: Redacted mediafire url>

    I'm really late to replying but thank you so much for this :D

    Now hopefully it still works with all the changes done while I've been inactive :D
     
    Last edited by a moderator: Nov 9, 2016
  14. Offline

    Snowybearr

    Deathfromace Longest thanks I have ever seen on here. Lol. :eek:
     
  15. Offline

    Deathfromace

    Snowybearr At least I came back to thank him :D though sadly it does not seem to work on newest build so hopefully np98765 wouldn't mind coming back once more to help me :D
     
  16. Offline

    Snowybearr

    Deathfromace Yeah I suppose, I'm sure someone will remake it for ya, since it's a pretty easy plugin according to the posts here.
     

Share This Page