From c3c7fe08b64acc3571d0118a3ac8da2bd2c45f11 Mon Sep 17 00:00:00 2001 From: Glitchfinder Date: Mon, 12 Nov 2012 19:53:55 -0800 Subject: [PATCH] Fixing a bug where an entity dealing 0 damage still earned experience. --- .../java/com/gmail/nossr50/listeners/EntityListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 133f86c6d..e26fa5438 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -57,9 +57,11 @@ public class EntityListener implements Listener { */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { - if (event instanceof FakeEntityDamageByEntityEvent) { + if (event instanceof FakeEntityDamageByEntityEvent) + return; + + if(event.getDamage() <= 0) return; - } Entity attacker = event.getDamager(); Entity defender = event.getEntity();