From 59e06c2319c66046cfaf0075b8b4d6e3fb36c82d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 7 May 2018 10:44:16 +1000 Subject: [PATCH] Fixes #1929 --- .../java/com/plotsquared/bukkit/listeners/PlayerEvents.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 3a85b7687..bd589a0c6 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -2378,6 +2378,10 @@ public class PlayerEvents extends PlotListener implements Listener { if (shooter instanceof Player) { // shooter is player player = (Player) shooter; } else { // shooter is not player + if (shooter instanceof BlockProjectileSource) { + Location sLoc = BukkitUtil.getLocation(((BlockProjectileSource) shooter).getBlock().getLocation()); + dplot = dArea.getPlot(sLoc); + } player = null; } } else { // Attacker is not player @@ -2452,6 +2456,8 @@ public class PlayerEvents extends PlotListener implements Listener { } } return true; + } else if (dplot != null && (!(dplot.equals(vplot)) || (vplot != null && dplot.isOwner(vplot.owner)))) { + return false; } // player is null return !(damager instanceof Arrow && !(victim instanceof Creature));