EntityLivingBase.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:4Space-5 作者:
public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
    ;
    ;
    setAbsorptionAmount(p_70037_1_.getFloat("AbsorptionAmount"));
    if ((p_70037_1_.hasKey("Attributes", 9)) && (this.worldObj != null)
            && (!this.worldObj.isRemote)) {
        SharedMonsterAttributes.func_151475_a(getAttributeMap(),
                p_70037_1_.getTagList("Attributes", 10));
    }
    if (p_70037_1_.hasKey("ActiveEffects", 9)) {
        NBTTagList nbttaglist = p_70037_1_.getTagList("ActiveEffects", 10);
        for (int i = 0; i < nbttaglist.tagCount(); i++) {
            NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
            PotionEffect potioneffect = PotionEffect
                    .readCustomPotionEffectFromNBT(nbttagcompound1);
            if (potioneffect != null) {
                this.activePotionsMap.put(
                        Integer.valueOf(potioneffect.getPotionID()),
                        potioneffect);
            }
        }
    }
    if (p_70037_1_.hasKey("HealF", 99)) {
        setHealth(p_70037_1_.getFloat("HealF"));
    } else {
        NBTBase nbtbase = p_70037_1_.getTag("Health");
        if (nbtbase == null) {
            setHealth(getMaxHealth());
        } else if (nbtbase.getId() == 5) {
            setHealth(((NBTTagFloat) nbtbase).func_150288_h());
        } else if (nbtbase.getId() == 2) {
            setHealth(((NBTTagShort) nbtbase).func_150289_e());
        }
    }
    this.hurtTime = p_70037_1_.getShort("HurtTime");
    this.deathTime = p_70037_1_.getShort("DeathTime");
    this.attackTime = p_70037_1_.getShort("AttackTime");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号