Fixed an issue where health stacking with pandas may throw an error.

This commit is contained in:
Brianna 2019-12-03 18:12:35 -05:00
parent 461da02103
commit 5308d1bf44
1 changed files with 3 additions and 1 deletions

View File

@ -200,7 +200,9 @@ public class EntityStack {
if (entity == null) return;
synchronized (healthLock) {
entity.setHealth(Settings.STACK_ENTITY_HEALTH.getBoolean()
&& !this.health.isEmpty() ? this.health.removeFirst() : entity.getMaxHealth());
&& !health.isEmpty()
? (health.getFirst() > entity.getMaxHealth() ? entity.getMaxHealth() : health.removeFirst())
: entity.getMaxHealth());
}
}