Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.mcreator.regiotime.item;
- import net.minecraftforge.fml.relauncher.SideOnly;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.common.registry.GameRegistry;
- import net.minecraftforge.common.util.EnumHelper;
- import net.minecraftforge.client.model.ModelLoader;
- import net.minecraftforge.client.event.ModelRegistryEvent;
- import net.minecraft.util.ResourceLocation;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.ItemArmor;
- import net.minecraft.item.Item;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.Entity;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.client.renderer.block.model.ModelResourceLocation;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.client.model.ModelBox;
- import net.minecraft.client.model.ModelBiped;
- import net.minecraft.client.model.ModelBase;
- import net.mcreator.regiotime.ElementsRegiotime;
- @ElementsRegiotime.ModElement.Tag
- public class ItemCowboy extends ElementsRegiotime.ModElement {
- @GameRegistry.ObjectHolder("regiotime:cowboyhelmet")
- public static final Item helmet = null;
- @GameRegistry.ObjectHolder("regiotime:cowboybody")
- public static final Item body = null;
- @GameRegistry.ObjectHolder("regiotime:cowboylegs")
- public static final Item legs = null;
- @GameRegistry.ObjectHolder("regiotime:cowboyboots")
- public static final Item boots = null;
- public ItemCowboy(ElementsRegiotime instance) {
- super(instance, 28);
- }
- @Override
- public void initElements() {
- ItemArmor.ArmorMaterial enuma = EnumHelper.addArmorMaterial("COWBOY", "regiotime:1", 25, new int[]{2, 5, 6, 2}, 9,
- (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("")), 0f);
- elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.HEAD) {
- @Override
- @SideOnly(Side.CLIENT)
- public ModelBiped getArmorModel(EntityLivingBase living, ItemStack stack, EntityEquipmentSlot slot, ModelBiped defaultModel) {
- ModelBiped armorModel = new ModelBiped();
- armorModel.bipedHead = new Modeltestv1().Headphone;
- armorModel.isSneak = living.isSneaking();
- armorModel.isRiding = living.isRiding();
- armorModel.isChild = living.isChild();
- return armorModel;
- }
- @Override
- public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) {
- return "regiotime:textures/headphone.png";
- }
- }.setUnlocalizedName("cowboyhelmet").setRegistryName("cowboyhelmet").setCreativeTab(CreativeTabs.COMBAT));
- }
- @SideOnly(Side.CLIENT)
- @Override
- public void registerModels(ModelRegistryEvent event) {
- ModelLoader.setCustomModelResourceLocation(helmet, 0, new ModelResourceLocation("regiotime:cowboyhelmet", "inventory"));
- }
- public static class Modeltestv1 extends ModelBase {
- private final ModelRenderer Headphone;
- public Modeltestv1() {
- textureWidth = 128;
- textureHeight = 128;
- Headphone = new ModelRenderer(this);
- Headphone.setRotationPoint(9.0F, -8.0F, -0.5F);
- Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -5.0F, -1.0F, 0.0F, 1, 4, 1, 0.0F, false));
- Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -14.0F, -1.0F, 0.0F, 1, 4, 1, 0.0F, false));
- Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -15.0F, 3.0F, -1.0F, 2, 3, 3, 0.0F, false));
- Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -5.0F, 3.0F, -1.0F, 2, 3, 3, 0.0F, false));
- Headphone.cubeList.add(new ModelBox(Headphone, 0, 0, -14.0F, -1.0F, 0.0F, 10, 1, 1, 0.0F, false));
- }
- @Override
- public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
- Headphone.render(f5);
- }
- public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
- modelRenderer.rotateAngleX = x;
- modelRenderer.rotateAngleY = y;
- modelRenderer.rotateAngleZ = z;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement