From 3a4221bdf739246775b4e94fb9fbdca0c66153c9 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Oct 2019 14:47:17 -0400 Subject: [PATCH] Don't spawn empty exp orbs. --- .../com/songoda/ultimatestacker/entity/EntityStack.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/songoda/ultimatestacker/entity/EntityStack.java b/src/main/java/com/songoda/ultimatestacker/entity/EntityStack.java index 93b3d77..de8a7a7 100644 --- a/src/main/java/com/songoda/ultimatestacker/entity/EntityStack.java +++ b/src/main/java/com/songoda/ultimatestacker/entity/EntityStack.java @@ -126,7 +126,8 @@ public class EntityStack { if (!preStackedDrops.isEmpty()) DropUtils.processStackedDrop(killed, preStackedDrops); - killedLocation.getWorld().spawn(killedLocation, ExperienceOrb.class).setExperience(droppedExp * amount); + if (droppedExp > 0) + killedLocation.getWorld().spawn(killedLocation, ExperienceOrb.class).setExperience(droppedExp * amount); if (killed.getKiller() == null) return; UltimateStacker.getInstance().addExp(killed.getKiller(), this); @@ -200,13 +201,13 @@ public class EntityStack { } public void addHealth(double health) { - synchronized(healthLock) { + synchronized (healthLock) { this.health.addLast(health); } } public void mergeHealth(EntityStack stack) { - synchronized(healthLock) { + synchronized (healthLock) { this.health.addAll(stack.health); } }