From c883f2f7d939797c73598b809830372f9d73206c Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Sun, 2 Nov 2014 20:11:06 +0100 Subject: [PATCH] Fixes #17 Creates #32 --- .../main/java/com/intellectualcrafters/plot/PlotMain.java | 4 +++- .../intellectualcrafters/plot/listeners/PlayerEvents.java | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index 533bf7f7b..a8f1dc5b6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -1289,7 +1289,9 @@ public class PlotMain extends JavaPlugin { "instabreak", "drop-protection", "forcefield", - "titles" + "titles", + "pve", + "pvp" ); List intervalFlags = Arrays.asList( "feed", diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index d68f210a0..773dc1c56 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -730,10 +730,16 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (!PlotMain.hasPermission(p,"plots.admin")) { PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); e.setCancelled(true); + return; } } else - if (!plot.hasRights(p)) { + if(aPlr && !booleanFlag(plot, "pvp")) + return; + if(!aPlr && !booleanFlag(plot, "pve")) + return; + assert plot != null; + if (!plot.hasRights(p)) { if (!PlotMain.hasPermission(p,"plots.admin")) { PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); e.setCancelled(true);