So I've been working on this mod for a little bit of time and I had little problems getting "3-D" weapon models to work, and "2-D" re textures of base vanilla armor to work, but I can't seem to get my 3-D armor to work. Can someone show me an appropriate way to get it to render these are the two main classes I believe you will need for reference. for reference my helmet is called w1_helmet! Here are the classes. Just for a note the armor works technically, just without a model.
Balemia Class (main class)
package trunix.balemia;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.SwordItem;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import trunix.balemia.lists.ArmorMaterialList;
import trunix.balemia.lists.ItemList;
import trunix.balemia.lists.ToolMaterialList;
@Mod("balemia")
public class Balemia {
public static Balemia instance;
public static final String modid = "balemia";
private static final Logger logger = LogManager.getLogger(modid);
public static final ItemGroup balemia = new BalemiaItemGroup();
public Balemia() {
instance = this;
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries);
MinecraftForge.EVENT_BUS.register(this);
}
private void setup (final FMLCommonSetupEvent event) {
logger.info("setup reached");
}
private void clientRegistries (final FMLClientSetupEvent event) {
logger.info("clientRegistries reached");
}
@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public static void registerItems(final RegistryEvent.Register<Item> event) {
event.getRegistry().registerAll (
//Maces
ItemList.woodenoak_mace = new SwordItem(ToolMaterialList.mace_mat, -1, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("woodenoak_mace")),
ItemList.woodenspruce_mace = new SwordItem(ToolMaterialList.mace_mat, -1, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("woodenspruce_mace")),
ItemList.woodenbirch_mace = new SwordItem(ToolMaterialList.mace_mat, -1, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("woodenbirch_mace")),
ItemList.woodenjungle_mace = new SwordItem(ToolMaterialList.mace_mat, -1, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("woodenjungle_mace")),
ItemList.woodenacacia_mace = new SwordItem(ToolMaterialList.mace_mat, -1, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("woodenacacia_mace")),
ItemList.woodendarkoak_mace = new SwordItem(ToolMaterialList.mace_mat, -1, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("woodendarkoak_mace")),
ItemList.stone_mace = new SwordItem(ToolMaterialList.mace_mat, 3, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("stone_mace")),
ItemList.iron_mace = new SwordItem(ToolMaterialList.mace_mat, 5, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("iron_mace")),
ItemList.gold_mace = new SwordItem(ToolMaterialList.mace_mat, 3, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("gold_mace")),
ItemList.diamond_mace = new SwordItem(ToolMaterialList.mace_mat, 7, -3.2f, new Item.Properties().group(balemia)).setRegistryName(location("diamond_mace")),
//Swords
ItemList.w1_sword = new SwordItem(ToolMaterialList.w_mat, 6, -2.4f, new Item.Properties().group(balemia)).setRegistryName(location("w1_sword")),
ItemList.w2_sword = new SwordItem(ToolMaterialList.w_mat, 8, -2.4f, new Item.Properties().group(balemia)).setRegistryName(location("w2_sword")),
ItemList.w3_sword = new SwordItem(ToolMaterialList.w_mat, 10, -2.4f, new Item.Properties().group(balemia)).setRegistryName(location("w3_sword")),
//Armor
ItemList.w1_helmet = new ArmorItem(ArmorMaterialList.w_mat,EquipmentSlotType.HEAD,new Item.Properties().group(balemia)).setRegistryName(location("w1_helmet"))
//Shields
);
logger.info("items reached");
}
private static ResourceLocation location(String name) {
return new ResourceLocation(modid,name);
}
}
}
and here is my ArmorMaterialList enum:
package trunix.balemia.lists;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.IArmorMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import trunix.balemia.Balemia;
public enum ArmorMaterialList implements IArmorMaterial{
w_mat("w_mat",400, new int[] {2,5,6,2}, 25, ItemList.w_mat, "item.armor.equip_iron", 0.0f);
private static final int[] max_damage_array = new int[]{13,15,16,11};
private String name, equipSound;
private int durability, enchantability;
private Item repairItem;
private int[] damageReductionAmounts;
private float toughness;
private ArmorMaterialList(String name, int durability, int[] damageReductionAmounts, int enchantability, Item repairItem, String equipSound, float toughness) {
this.name=name;
this.equipSound=equipSound;
this.durability=durability;
this.enchantability=enchantability;
this.repairItem=repairItem;
this.damageReductionAmounts=damageReductionAmounts;
this.toughness=toughness;
}
@Override
public int getDurability(EquipmentSlotType slot) {
return max_damage_array[slot.getIndex()]*this.durability;
}
@Override
public int getDamageReductionAmount(EquipmentSlotType slot) {
return this.damageReductionAmounts[slot.getIndex()];
}
@Override
public int getEnchantability() {
return this.enchantability;
}
@Override
public SoundEvent getSoundEvent() {
return new SoundEvent(new ResourceLocation(equipSound));
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(this.repairItem);
}
@Override
public String getName() {
return Balemia.modid + ":" + this.name;
}
@Override
public float getToughness() {
return this.toughness;
}
}