[WorldGuard API] How to get a current flag state?

Discussion in 'Plugin Development' started by Evaluations, Nov 26, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Evaluations

    I currently have it so if it's the region "spawn" in the world "PlasmaPvP" a player can't go in the region whilst combat tagged. I want to make it check if the region flag has PvP to DENY instead.



    Event:
    Code:java
    1. @EventHandler
    2. public void bounceOnRegion(PlayerMoveEvent e)
    3. {
    4. Player p = e.getPlayer();
    5. Location to = e.getTo();
    6. Location from = e.getFrom();
    7.  
    8. ProtectedRegion region = this.plugin.getWorldGuard().getRegionManager(Bukkit.getServer().getWorld("PlasmaPvP")).getRegion("spawn"); // region grabber (where I want to check if the region has pvp denied
    9.  
    10. com.sk89q.worldedit.Vector vfrom = new com.sk89q.worldedit.Vector(from.getX(), from.getY(), from.getZ());
    11. com.sk89q.worldedit.Vector vto = new com.sk89q.worldedit.Vector(to.getX(), to.getY(), to.getZ());
    12. if (HandleTag.contains(p.getName())) {
    13. if ((region.contains(vto)) && (!region.contains(vfrom)))
    14. {
    15. // code
    16. {


    I'm basically trying to get a region that has PvP = deny, I have this current method but it's not very efficient and limits you to only one region.


    How could I get a region's current state of PvP that is set to deny?
     
  2. Offline

    Evaluations

  3. Offline

    Evaluations

    Bump! Help D:
     
Thread Status:
Not open for further replies.

Share This Page