Don't spawn empty exp orbs.

This commit is contained in:
Brianna 2019-10-08 14:47:17 -04:00
parent 728008c678
commit 3a4221bdf7

View File

@ -126,7 +126,8 @@ public class EntityStack {
if (!preStackedDrops.isEmpty()) if (!preStackedDrops.isEmpty())
DropUtils.processStackedDrop(killed, preStackedDrops); 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; if (killed.getKiller() == null) return;
UltimateStacker.getInstance().addExp(killed.getKiller(), this); UltimateStacker.getInstance().addExp(killed.getKiller(), this);
@ -200,13 +201,13 @@ public class EntityStack {
} }
public void addHealth(double health) { public void addHealth(double health) {
synchronized(healthLock) { synchronized (healthLock) {
this.health.addLast(health); this.health.addLast(health);
} }
} }
public void mergeHealth(EntityStack stack) { public void mergeHealth(EntityStack stack) {
synchronized(healthLock) { synchronized (healthLock) {
this.health.addAll(stack.health); this.health.addAll(stack.health);
} }
} }