diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 3cfe5ac44c..9747a8866b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1332,7 +1332,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void updateScaledHealth() { AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().getAttributeMap(); - Collection set = attributemapserver.c(); // PAIL: Rename + Collection set = attributemapserver.c(); // PAIL: Rename injectScaledMaxHealth(set, true); @@ -1347,13 +1347,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel())); } - public void injectScaledMaxHealth(Collection collection, boolean force) { + public void injectScaledMaxHealth(Collection collection, boolean force) { if (!scaledHealth && !force) { return; } - for (Object genericInstance : collection) { - IAttribute attribute = ((AttributeInstance) genericInstance).getAttribute(); - if (attribute.getName().equals("generic.maxHealth")) { + for (AttributeInstance genericInstance : collection) { + if (genericInstance.getAttribute().getName().equals("generic.maxHealth")) { collection.remove(genericInstance); break; }