Advertisement
Guest User

the armor is not put in its place

a guest
May 10th, 2020
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.94 KB | None | 0 0
  1.  
  2. package net.mcreator.regiotime.item;
  3.  
  4. import net.minecraftforge.fml.relauncher.SideOnly;
  5. import net.minecraftforge.fml.relauncher.Side;
  6. import net.minecraftforge.fml.common.registry.GameRegistry;
  7. import net.minecraftforge.common.util.EnumHelper;
  8. import net.minecraftforge.client.model.ModelLoader;
  9. import net.minecraftforge.client.event.ModelRegistryEvent;
  10.  
  11. import net.minecraft.util.ResourceLocation;
  12. import net.minecraft.item.ItemStack;
  13. import net.minecraft.item.ItemArmor;
  14. import net.minecraft.item.Item;
  15. import net.minecraft.inventory.EntityEquipmentSlot;
  16. import net.minecraft.entity.EntityLivingBase;
  17. import net.minecraft.entity.Entity;
  18. import net.minecraft.creativetab.CreativeTabs;
  19. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  20. import net.minecraft.client.model.ModelRenderer;
  21. import net.minecraft.client.model.ModelBox;
  22. import net.minecraft.client.model.ModelBiped;
  23. import net.minecraft.client.model.ModelBase;
  24.  
  25. import net.mcreator.regiotime.ElementsRegiotime;
  26.  
  27. @ElementsRegiotime.ModElement.Tag
  28. public class ItemCowboy extends ElementsRegiotime.ModElement {
  29.     @GameRegistry.ObjectHolder("regiotime:cowboyhelmet")
  30.     public static final Item helmet = null;
  31.     @GameRegistry.ObjectHolder("regiotime:cowboybody")
  32.     public static final Item body = null;
  33.     @GameRegistry.ObjectHolder("regiotime:cowboylegs")
  34.     public static final Item legs = null;
  35.     @GameRegistry.ObjectHolder("regiotime:cowboyboots")
  36.     public static final Item boots = null;
  37.     public ItemCowboy(ElementsRegiotime instance) {
  38.         super(instance, 28);
  39.     }
  40.  
  41.     @Override
  42.     public void initElements() {
  43.         ItemArmor.ArmorMaterial enuma = EnumHelper.addArmorMaterial("COWBOY", "regiotime:1", 25, new int[]{2, 5, 6, 2}, 9,
  44.                 (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("")), 0f);
  45.         elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.HEAD) {
  46.             @Override
  47.             @SideOnly(Side.CLIENT)
  48.             public ModelBiped getArmorModel(EntityLivingBase living, ItemStack stack, EntityEquipmentSlot slot, ModelBiped defaultModel) {
  49.                 ModelBiped armorModel = new ModelBiped();
  50.                 armorModel.bipedHead = new Modeltestv1().Headphone;
  51.                 armorModel.isSneak = living.isSneaking();
  52.                 armorModel.isRiding = living.isRiding();
  53.                 armorModel.isChild = living.isChild();
  54.                 return armorModel;
  55.             }
  56.  
  57.             @Override
  58.             public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) {
  59.                 return "regiotime:textures/headphone.png";
  60.             }
  61.         }.setUnlocalizedName("cowboyhelmet").setRegistryName("cowboyhelmet").setCreativeTab(CreativeTabs.COMBAT));
  62.     }
  63.  
  64.     @SideOnly(Side.CLIENT)
  65.     @Override
  66.     public void registerModels(ModelRegistryEvent event) {
  67.         ModelLoader.setCustomModelResourceLocation(helmet, 0, new ModelResourceLocation("regiotime:cowboyhelmet", "inventory"));
  68.     }
  69.     public static class Modeltestv1 extends ModelBase {
  70.         private final ModelRenderer Headphone;
  71.         public Modeltestv1() {
  72.             textureWidth = 128;
  73.             textureHeight = 128;
  74.             Headphone = new ModelRenderer(this);
  75.             Headphone.setRotationPoint(9.0F, -8.0F, -0.5F);
  76.             Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -5.0F, -1.0F, 0.0F, 1, 4, 1, 0.0F, false));
  77.             Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -14.0F, -1.0F, 0.0F, 1, 4, 1, 0.0F, false));
  78.             Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -15.0F, 3.0F, -1.0F, 2, 3, 3, 0.0F, false));
  79.             Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -5.0F, 3.0F, -1.0F, 2, 3, 3, 0.0F, false));
  80.             Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -14.0F, -1.0F, 0.0F, 10, 1, 1, 0.0F, false));
  81.         }
  82.  
  83.         @Override
  84.         public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
  85.             Headphone.render(f5);
  86.         }
  87.  
  88.         public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
  89.             modelRenderer.rotateAngleX = x;
  90.             modelRenderer.rotateAngleY = y;
  91.             modelRenderer.rotateAngleZ = z;
  92.         }
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement