This commit is contained in:
Jesse Boyd 2018-05-07 10:44:16 +10:00
parent 9a7ce84e1c
commit 59e06c2319
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -2378,6 +2378,10 @@ public class PlayerEvents extends PlotListener implements Listener {
if (shooter instanceof Player) { // shooter is player if (shooter instanceof Player) { // shooter is player
player = (Player) shooter; player = (Player) shooter;
} else { // shooter is not player } else { // shooter is not player
if (shooter instanceof BlockProjectileSource) {
Location sLoc = BukkitUtil.getLocation(((BlockProjectileSource) shooter).getBlock().getLocation());
dplot = dArea.getPlot(sLoc);
}
player = null; player = null;
} }
} else { // Attacker is not player } else { // Attacker is not player
@ -2452,6 +2456,8 @@ public class PlayerEvents extends PlotListener implements Listener {
} }
} }
return true; return true;
} else if (dplot != null && (!(dplot.equals(vplot)) || (vplot != null && dplot.isOwner(vplot.owner)))) {
return false;
} }
// player is null // player is null
return !(damager instanceof Arrow && !(victim instanceof Creature)); return !(damager instanceof Arrow && !(victim instanceof Creature));