Skip to content

Commit

Permalink
quick bit of efficiency boosting
Browse files Browse the repository at this point in the history
let's not overparse
  • Loading branch information
mcmonkey4eva committed Aug 13, 2015
1 parent 31090a2 commit 45c17c4
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -170,14 +170,14 @@ else if (name.startsWith("damage_")) {
@EventHandler(ignoreCancelled = true)
public void onEntityKilled(EntityDamageEvent event) {
entity = new dEntity(event.getEntity());
damage = new Element(event.getDamage());
final_damage = new Element(event.getFinalDamage());
// Check for possibility of death first
if (entity.isValid() && entity.isLivingEntity()) {
if (final_damage.asDouble() < entity.getLivingEntity().getHealth()) {
if (event.getFinalDamage() < entity.getLivingEntity().getHealth()) {
return;
}
}
damage = new Element(event.getDamage());
final_damage = new Element(event.getFinalDamage());
cause = new Element(event.getCause().name().toLowerCase());
damager = null;
projectile = null;
Expand Down

0 comments on commit 45c17c4

Please sign in to comment.