public void a(NBTTagCompound nbttagcompound) { this.m(nbttagcompound.getFloat("AbsorptionAmount")); if (nbttagcompound.hasKey("Attributes") && this.world != null && !this.world.isStatic) { GenericAttributes.a( this.aX(), nbttagcompound.getList("Attributes"), this.world == null ? null : this.world.getLogger()); } if (nbttagcompound.hasKey("ActiveEffects")) { NBTTagList nbttaglist = nbttagcompound.getList("ActiveEffects"); for (int i = 0; i < nbttaglist.size(); ++i) { NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.get(i); MobEffect mobeffect = MobEffect.b(nbttagcompound1); this.effects.put(Integer.valueOf(mobeffect.getEffectId()), mobeffect); } } // CraftBukkit start if (nbttagcompound.hasKey("Bukkit.MaxHealth")) { NBTBase nbtbase = nbttagcompound.get("Bukkit.MaxHealth"); if (nbtbase.getTypeId() == 5) { this.getAttributeInstance(GenericAttributes.a) .setValue((double) ((NBTTagFloat) nbtbase).data); } else if (nbtbase.getTypeId() == 3) { this.getAttributeInstance(GenericAttributes.a) .setValue((double) ((NBTTagInt) nbtbase).data); } } // CraftBukkit end if (nbttagcompound.hasKey("HealF")) { this.setHealth(nbttagcompound.getFloat("HealF")); } else { NBTBase nbtbase = nbttagcompound.get("Health"); if (nbtbase == null) { this.setHealth(this.getMaxHealth()); } else if (nbtbase.getTypeId() == 5) { this.setHealth(((NBTTagFloat) nbtbase).data); } else if (nbtbase.getTypeId() == 2) { this.setHealth((float) ((NBTTagShort) nbtbase).data); } } this.hurtTicks = nbttagcompound.getShort("HurtTime"); this.deathTicks = nbttagcompound.getShort("DeathTime"); this.attackTicks = nbttagcompound.getShort("AttackTime"); }
public void a(NBTTagCompound nbttagcompound) { this.m(nbttagcompound.getFloat("AbsorptionAmount")); if (nbttagcompound.hasKeyOfType("Attributes", 9) && this.world != null && !this.world.isStatic) { GenericAttributes.a(this.bc(), nbttagcompound.getList("Attributes", 10)); } if (nbttagcompound.hasKeyOfType("ActiveEffects", 9)) { NBTTagList nbttaglist = nbttagcompound.getList("ActiveEffects", 10); for (int i = 0; i < nbttaglist.size(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.get(i); MobEffect mobeffect = MobEffect.b(nbttagcompound1); if (mobeffect != null) { this.effects.put(Integer.valueOf(mobeffect.getEffectId()), mobeffect); } } } if (nbttagcompound.hasKeyOfType("HealF", 99)) { this.setHealth(nbttagcompound.getFloat("HealF")); } else { NBTBase nbtbase = nbttagcompound.get("Health"); if (nbtbase == null) { this.setHealth(this.getMaxHealth()); } else if (nbtbase.getTypeId() == 5) { this.setHealth(((NBTTagFloat) nbtbase).h()); } else if (nbtbase.getTypeId() == 2) { this.setHealth((float) ((NBTTagShort) nbtbase).e()); } } this.hurtTicks = nbttagcompound.getShort("HurtTime"); this.deathTicks = nbttagcompound.getShort("DeathTime"); this.attackTicks = nbttagcompound.getShort("AttackTime"); }