This commit is contained in:
Jesse Boyd 2018-06-23 14:12:21 +10:00
parent 9020d740d1
commit 1772fdab16
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -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)