From 1772fdab16b304277d5ebfcc070fe39cb1285798 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 23 Jun 2018 14:12:21 +1000 Subject: [PATCH] Fixes #1988 --- .../java/com/plotsquared/bukkit/listeners/PlayerEvents.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index a57c5f924..ecfff5d51 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -2370,6 +2370,7 @@ public class PlayerEvents extends PlotListener implements Listener { } } } + System.out.println("Cancel entity damage"); event.setCancelled(true); } } @@ -2512,10 +2513,9 @@ public class PlayerEvents extends PlotListener implements Listener { } return true; } else if (dplot != null && (!(dplot.equals(vplot)) || (vplot != null && Objects.equals(dplot.owner, vplot.owner)))) { - return false; + return vplot != null && Flags.PVE.isTrue(vplot); } - // player is null - return !(damager instanceof Arrow && !(victim instanceof Creature)); + return ((vplot != null && Flags.PVE.isTrue(vplot)) || !(damager instanceof Arrow && !(victim instanceof Creature))); } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)