Search in sources :

Example 11 with ASoldierUpgrade

use of de.sanandrew.mods.claysoldiers.util.soldier.upgrade.ASoldierUpgrade in project ClaySoldiersMod by SanAndreasP.

the class ClientProxy method applyUpgradeNbt.

@Override
public void applyUpgradeNbt(int entityId, byte upgradeRenderId, NBTTagCompound nbt) {
    Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(entityId);
    if (entity instanceof EntityClayMan) {
        EntityClayMan pahimar = (EntityClayMan) entity;
        ASoldierUpgrade upgrade = SoldierUpgrades.getUpgrade(upgradeRenderId);
        if (pahimar.hasUpgrade(upgrade)) {
            pahimar.getUpgrade(upgrade).setNbtTag(nbt);
        } else {
            pahimar.addUpgrade(upgrade).setNbtTag(nbt);
        }
    }
}
Also used : Entity(net.minecraft.entity.Entity) EntityClayMan(de.sanandrew.mods.claysoldiers.entity.EntityClayMan) ASoldierUpgrade(de.sanandrew.mods.claysoldiers.util.soldier.upgrade.ASoldierUpgrade)

Aggregations

ASoldierUpgrade (de.sanandrew.mods.claysoldiers.util.soldier.upgrade.ASoldierUpgrade)11 SoldierUpgradeInst (de.sanandrew.mods.claysoldiers.util.soldier.upgrade.SoldierUpgradeInst)6 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 IThrowableUpgrade (de.sanandrew.mods.claysoldiers.util.soldier.upgrade.IThrowableUpgrade)2 IAttributeInstance (net.minecraft.entity.ai.attributes.IAttributeInstance)2 MutableFloat (org.apache.commons.lang3.mutable.MutableFloat)2 Pair (de.sanandrew.core.manpack.util.javatuples.Pair)1 EntityClayMan (de.sanandrew.mods.claysoldiers.entity.EntityClayMan)1 IMount (de.sanandrew.mods.claysoldiers.entity.mount.IMount)1 ASoldierEffect (de.sanandrew.mods.claysoldiers.util.soldier.effect.ASoldierEffect)1 SoldierEffectInst (de.sanandrew.mods.claysoldiers.util.soldier.effect.SoldierEffectInst)1 AUpgradeLeftHanded (de.sanandrew.mods.claysoldiers.util.soldier.upgrade.lefthand.AUpgradeLeftHanded)1 Entity (net.minecraft.entity.Entity)1 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1 EntityItem (net.minecraft.entity.item.EntityItem)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1