Fixing a bug where an entity dealing 0 damage still earned experience.

This commit is contained in:
Glitchfinder 2012-11-12 19:53:55 -08:00
parent 4a52135a0b
commit c3c7fe08b6

View File

@ -57,9 +57,11 @@ public class EntityListener implements Listener {
*/ */
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (event instanceof FakeEntityDamageByEntityEvent) { if (event instanceof FakeEntityDamageByEntityEvent)
return;
if(event.getDamage() <= 0)
return; return;
}
Entity attacker = event.getDamager(); Entity attacker = event.getDamager();
Entity defender = event.getEntity(); Entity defender = event.getEntity();