[REQ] Guest Blocker - Simple (I think)

Discussion in 'Archived: Plugin Requests' started by Nazerb, Sep 30, 2011.

  1. Offline

    Nazerb

    Well all this has to do is people with a permissions cant;
    set things on fire
    openchests
    destroy chests
    use lava
    use water
    no guest to guest pvp?
    no tnt placement
    creeper stopper - use something else.

    I hope this is easy enough for someone.

    also they can't pvp. then they can't be stop greifing.
    Edit again: if this is possible no Guest-to-Guest pvp?

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

    Perdog

    Do you want multiple permissions? Like one for each? Or just one that stops them all?
     
  3. Offline

    Nazerb

    one for all would be prefrebale just to stop the guests greifing the easy ways - oh maybe no tnt placement.
     
  4. Offline

    Perdog

    I can give this a try, just give me an hour to get back to you, if I'm having to many problems I'll give up but it should be easy
     
  5. Offline

    Nazerb

    i keep adding ideas to it sorry about that.
     
  6. Offline

    Perdog

    That's fine :) Just give me more to do lol I'm currently wasting time wait for my gf to get off work in 4 hours :p

    Also,
    The no guest to guest thing.... I'm not sure how to go about that, and the creeper stopper, what do you mean by that?

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

    Nazerb

    The guest update is something i can handle when i upgrade there group, the creeper thing is so creepers dont blow up the terain.
     
  8. Offline

    Perdog

    I suggest creeperheal for that, VERY good plugin that I used on my server when I ran one. It can also undo TNT damage.
     
  9. Offline

    Nazerb

    ok thanks i can remove that one then :D
     
  10. Offline

    Perdog

    Okay so I've just finished it. I haven't tested it though (mainly cause I'm lazy at the moment and don't wanna go get my mouse :p) Just give yourself the GB.* permission, and try all the things you wanted added.

    I included the plugin.yml in the .zip so you can see what the different permissions are.
     

    Attached Files:

  11. Offline

    Nazerb

    Testing now. Thanks ill report back in a couple of mins.

    Doesnt seem to work.

    this is in the permissions:
    PHP:
                superpermbridge.GB.*: true
    Do you give the permissions to the guest?

    @Perdog are you meant to give the permissions to the guest?

    The no chest break works.

    You can test it on my server i uploaded it: 31.3.250.162:25643

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

    Perdog

    Yes, but the permission is just GB.*? What's the superpermbridge thing?
     
  13. Offline

    Nazerb

    is it for permissions 3.0 or permissionsbukkit

    Ignore all that now, i did it wrong but i can't open the chests or use tnt and fire but everything else still works.

    So lava, water, and destroying the chest
     
  14. Offline

    Perdog

    So the only thing not working is placing water and lava with a bucket and destroying chests? And you have the GB.* permission?
     
  15. Offline

    Nazerb

    yes, as the other things are blocked. like i said i have it on my server now
     
  16. Offline

    Perdog

    Okay, give me a few to try to solve this one, and I'll get back to you
     
  17. Offline

    Nazerb

    Im not sure if this was possible but could guests use the chests they place? If thats too hard just leave it.

    Code:
    2011-10-01 01:54:29 [SEVERE] Could not pass event BLOCK_BREAK to GuestBlocker
    java.lang.ClassCastException: me.Perdog.GuestBlocker.GuestBlockerPlayerListener cannot be cast to org.bukkit.event.block.BlockListener
    at org.bukkit.plugin.java.JavaPluginLoader$39.execute(JavaPluginLoader.java:511)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
    at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:195)
    at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:159)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:500)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:464)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    This is a error i noticed that keeps happening.

    ill be back tomorrow.

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

    Perdog

    Hold on got the new one, simple mistake on my part, here it is

    I could attempt this, not sure how I'm going to do it though, will try it though.
    This was happening because I put the BlockBreakEvent into the player listener when I SHOULD have put it into the block listener, fixed though :)
     

    Attached Files:

    Last edited by a moderator: Jun 19, 2016
  19. Offline

    MikeA

    Why not just use ModifyWorld which comes with PermissionsEx? It disallows guests to destroy -anything- with a single permission.
     
  20. Offline

    Nazerb

    Because i want them to play, oh and you don't even need a plugin for it :D

    same things not working for some reason

    Code:
    2011-10-01 13:04:14 [SEVERE] Could not pass event PLAYER_INTERACT to GuestBlocker
    java.lang.NullPointerException
    at me.Perdog.GuestBlocker.GuestBlockerPlayerListener.onPlayerInteract(GuestBlockerPlayerListener.java:17)
    at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:139)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:824)
    at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:36)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:464)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    This looks diffrent.

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

    Perdog

    Dammit... I have NPE's... I never know how to fix them :/
     
  22. Offline

    Nazerb

    Null Pointer Exception? what even is that. I guessed what it was :D
     
  23. Offline

    Nazerb

    @Perdog Fixable? Hows it going?
     
  24. Offline

    the_Zorro

    Null Pointer Exceptions are sometimes not that difficult as they look.
    Code:
        Material block = event.getClickedBlock().getType();
    This is line 17. The problem is here: If the player clicks in the air, the event 'onPlayerInteract' will be called, too.
    If you want to get the block then it says 'null', because the player did not click any block.
    you could change line 17 to:
    Code:
    Block block = event.getClickedBlock();
    and line 26 following to:
    Code:
    if(block != null) {
        if (((player.hasPermission("GB.OpenChest")) || (player.hasPermission("GB.*"))) &&
          (action == Action.RIGHT_CLICK_BLOCK) && (block.getType() == Material.CHEST)) {
          event.setCancelled(true);
        }
    }
    and everything would be okay, if there aren't any other misstakes. ;)
     
  25. Offline

    dralletje

    just use modify world from permissionsEX, it has all the things you want!
     

Share This Page