Skip to content

Instantly share code, notes, and snippets.

@Hamster-Furtif
Created October 21, 2015 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hamster-Furtif/7445a1ada0f7a7f3790a to your computer and use it in GitHub Desktop.
Save Hamster-Furtif/7445a1ada0f7a7f3790a to your computer and use it in GitHub Desktop.
package com.hamsterfurtif.masks.masques;
import com.hamsterfurtif.masks.Masks;
import com.hamsterfurtif.masks.lib.References;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemMaskLoup extends ItemMask{
public ItemMaskLoup() {
super("wolf");
this.setHasShader(true);
this.setUnlocalizedName("mask_wolf");
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if (stack.getItem() == Masks.mask_wolf) {
return References.MODID + ":" + "mask_wolf";
}
return null;
}
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot)
{
ModelBiped armorModel = null;
if (itemStack != null) {
if (itemStack.getItem() == Masks.mask_wolf) {
armorModel = Masks.proxy.getArmorModel();
}
}
if(armorModel != null){
armorModel.bipedHead.showModel = armorSlot == 0;
armorModel.bipedHeadwear.showModel = armorSlot == 0;
armorModel.bipedBody.showModel = armorSlot == 1 || armorSlot == 2;
armorModel.bipedRightArm.showModel = armorSlot == 1;
armorModel.bipedLeftArm.showModel = armorSlot == 1;
armorModel.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3;
armorModel.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3;
armorModel.isSneak = entityLiving.isSneaking();
armorModel.isRiding = entityLiving.isRiding();
armorModel.isChild = entityLiving.isChild();
armorModel.heldItemRight = entityLiving.getCurrentArmor(0) != null ? 1 :0;
if(entityLiving instanceof EntityPlayer){
armorModel.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2;
}
return armorModel;
}
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment