Advertisement
Guest User

Untitled

a guest
May 13th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.21 KB | None | 0 0
  1. public class RylinthianArmor extends ModArmor {
  2.     ModelBiped model = null;
  3.    
  4.     public RylinthianArmor(ArmorMaterial material, int renderIndex, int armorType, String unlocalizedName) {
  5.         super(material, renderIndex, armorType, unlocalizedName);
  6.     }
  7.     @Override
  8.     public String getArmorTexture(final ItemStack stack, final Entity entity, final int slot, final String type) {
  9.         return "magicmod:textures/armor/RylinthArmorBase.png";
  10.     }
  11.     @Override
  12.     @SideOnly(Side.CLIENT)
  13.     public ModelBiped getArmorModel(final EntityLivingBase entityLiving, final ItemStack itemStack, final int armorSlot) {
  14.         MagicMod.log.info("THIS IS A MARKER SHOWING THAT THIS WORKED\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  15.         if(this.model == null) {
  16.             switch(armorSlot) {
  17.             case 0: model = MagicMod.proxy.getArmorModel(0); break;
  18.             case 1: model = MagicMod.proxy.getArmorModel(1); break;
  19.             case 2: model = MagicMod.proxy.getArmorModel(2); break;
  20.             }
  21.         }
  22.         if (this.model != null) {
  23.             this.model.bipedHead.showModel = false;//(armorSlot == 0);
  24.             this.model.bipedHeadwear.showModel = false;//(armorSlot == 0);
  25.             this.model.bipedBody.showModel = false;//(armorSlot == 1);
  26.             this.model.bipedRightLeg.showModel = false;//(armorSlot == 2);
  27.             this.model.bipedLeftLeg.showModel = false;//(armorSlot == 2);
  28.             this.model.isSneak = entityLiving.isSneaking();
  29.             this.model.isRiding = entityLiving.isRiding();
  30.             this.model.isChild = entityLiving.isChild();
  31.             this.model.aimedBow = false;
  32.             this.model.heldItemRight = ((entityLiving.getHeldItem() != null) ? 1 : 0);
  33.             if (entityLiving instanceof EntityPlayer && ((EntityPlayer)entityLiving).getItemInUseDuration() > 0) {
  34.                 final EnumAction enumaction = ((EntityPlayer)entityLiving).getItemInUse().getItemUseAction();
  35.                 if (enumaction == EnumAction.BLOCK) {
  36.                     this.model.heldItemRight = 3;
  37.                 }
  38.                 else if (enumaction == EnumAction.BOW) {
  39.                     this.model.aimedBow = true;
  40.                 }
  41.             }
  42.         }
  43.         return this.model;
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement