package net.mcreator.falloutarmor.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.world.World;
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.player.EntityPlayer;
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.falloutarmor.procedure.ProcedureX03armorBodyTickEvent;
import net.mcreator.falloutarmor.ElementsFalloutArmorMod;
import java.util.Map;
import java.util.HashMap;
@ElementsFalloutArmorMod.ModElement.Tag
public class ItemX03armor extends ElementsFalloutArmorMod.ModElement {
@GameRegistry.ObjectHolder("fallout_armor:x_01armorhelmet")
public static final Item helmet = null;
@GameRegistry.ObjectHolder("fallout_armor:x_01armorbody")
public static final Item body = null;
@GameRegistry.ObjectHolder("fallout_armor:x_01armorlegs")
public static final Item legs = null;
@GameRegistry.ObjectHolder("fallout_armor:x_01armorboots")
public static final Item boots = null;
public ItemX03armor(ElementsFalloutArmorMod instance) {
super(instance, 1);
}
@Override
public void initElements() {
ItemArmor.ArmorMaterial enuma = EnumHelper.addArmorMaterial("X_01ARMOR", "fallout_armor:xo1_armor_", 100, 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 Modelxo1_head().HEAD;
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 "fallout_armor:textures/xo1_head.png";
}
}.setUnlocalizedName("x_01armorhelmet").setRegistryName("x_01armorhelmet").setCreativeTab(CreativeTabs.COMBAT));
elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.CHEST) {
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase living, ItemStack stack, EntityEquipmentSlot slot, ModelBiped defaultModel) {
ModelBiped armorModel = new ModelBiped();
armorModel.bipedBody = new Modelxo1_body().body;
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 "fallout_armor:textures/xo1_head.png";
}
@Override
public void onArmorTick(World world, EntityPlayer entity, ItemStack itemstack) {
int x = (int) entity.posX;
int y = (int) entity.posY;
int z = (int) entity.posZ;
{
Map<String, Object> $_dependencies = new HashMap<>();
$_dependencies.put("entity", entity);
$_dependencies.put("itemstack", itemstack);
ProcedureX03armorBodyTickEvent.executeProcedure($_dependencies);
}
}
}.setUnlocalizedName("x_01armorbody").setRegistryName("x_01armorbody").setCreativeTab(CreativeTabs.COMBAT));
elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.LEGS) {
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase living, ItemStack stack, EntityEquipmentSlot slot, ModelBiped defaultModel) {
ModelBiped armorModel = new ModelBiped();
armorModel.bipedLeftLeg = new Modelxo1_leggs().leftleg;
armorModel.bipedRightLeg = new Modelxo1_leggs().rightleg;
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 "fallout_armor:textures/xo1_head.png";
}
}.setUnlocalizedName("x_01armorlegs").setRegistryName("x_01armorlegs").setCreativeTab(CreativeTabs.COMBAT));
elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.FEET) {
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase living, ItemStack stack, EntityEquipmentSlot slot, ModelBiped defaultModel) {
ModelBiped armorModel = new ModelBiped();
armorModel.bipedLeftLeg = new Modelxo1_boots().leftboot;
armorModel.bipedRightLeg = new Modelxo1_boots().rightboot;
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 "fallout_armor:textures/xo1_head.png";
}
}.setUnlocalizedName("x_01armorboots").setRegistryName("x_01armorboots").setCreativeTab(CreativeTabs.COMBAT));
}
@SideOnly(Side.CLIENT)
@Override
public void registerModels(ModelRegistryEvent event) {
ModelLoader.setCustomModelResourceLocation(helmet, 0, new ModelResourceLocation("fallout_armor:x_01armorhelmet", "inventory"));
ModelLoader.setCustomModelResourceLocation(body, 0, new ModelResourceLocation("fallout_armor:x_01armorbody", "inventory"));
ModelLoader.setCustomModelResourceLocation(legs, 0, new ModelResourceLocation("fallout_armor:x_01armorlegs", "inventory"));
ModelLoader.setCustomModelResourceLocation(boots, 0, new ModelResourceLocation("fallout_armor:x_01armorboots", "inventory"));
}