Advertisement
JoeAteTheBeans

ArmourClass

Feb 21st, 2021
587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.79 KB | None | 0 0
  1. package com.joeatethebeans.mineite.objects.armour;
  2.  
  3. import com.joeatethebeans.mineite.Main;
  4. import com.joeatethebeans.mineite.init.ItemInit;
  5. import com.joeatethebeans.mineite.util.IHasModel;
  6.  
  7. import net.minecraft.client.model.ModelBiped;
  8. import net.minecraft.creativetab.CreativeTabs;
  9. import net.minecraft.entity.EntityLivingBase;
  10. import net.minecraft.inventory.EntityEquipmentSlot;
  11. import net.minecraft.item.ItemArmor;
  12. import net.minecraft.item.ItemStack;
  13.  
  14. public class ShitiumArmourBase extends ItemArmor implements IHasModel{
  15.    
  16.     public ShitiumArmourBase(String name, int layer,ArmorMaterial materialIn, EntityEquipmentSlot equipmentSlotIn) {
  17.         super(materialIn, layer, equipmentSlotIn);
  18.         setUnlocalizedName(name);
  19.         setRegistryName(name);
  20.         setCreativeTab(CreativeTabs.TOOLS);
  21.        
  22.         ItemInit.ITEMS.add(this);
  23.     }
  24.  
  25.     @Override
  26.     public void registerModels() { 
  27.         Main.proxy.registerItemRenderer(this, 0, "inventory");
  28.     }
  29.    
  30.     @Override
  31.     public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot,
  32.             ModelBiped _default) {
  33.         if (itemStack != ItemStack.EMPTY) {
  34.             if (itemStack.getItem() instanceof ItemArmor) {
  35.                 CustomModelShitium model = new CustomModelShitium();
  36.                 model.bipedHead.showModel = armorSlot == EntityEquipmentSlot.HEAD;
  37.                 model.bipedBody.showModel = armorSlot == EntityEquipmentSlot.CHEST;
  38.                 model.bipedLeftLeg.showModel = armorSlot == EntityEquipmentSlot.LEGS;
  39.                 model.bipedRightLeg.showModel = armorSlot == EntityEquipmentSlot.LEGS;
  40.                
  41.                 model.isChild = _default.isChild;
  42.                 model.isRiding = _default.isRiding;
  43.                 model.isSneak = _default.isSneak;
  44.                 model.rightArmPose = _default.rightArmPose;
  45.                 model.leftArmPose = _default.leftArmPose;
  46.                
  47.                 return model;
  48.             }
  49.         }
  50.         return null;
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement