Yeah it's me again. Well, i was making armor for my mod and something went wrong when I tried to put the model armor textures to my mod. That's basically my problem.
These are my packages and clases:
And this is what I have in the two classes I have added the armor.
The DragonRockItems class:
package metadestroyer.dragonrock.init;
import metadestroyer.dragonrock.DragonRockMod;
import metadestroyer.dragonrock.Reference;
import metadestroyer.dragonrock.item.ItemDragonArmour;
import metadestroyer.dragonrock.item.ItemDragonAxe;
import metadestroyer.dragonrock.item.ItemDragonPickaxe;
import metadestroyer.dragonrock.item.ItemDragonShovel;
import metadestroyer.dragonrock.item.ItemDragonSword;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class DragonRockItems {
public static Item dragon_ingot;
public static Item bedrock_shard;
public static Item dragon_pickaxe;
public static Item dragon_axe;
public static Item dragon_shovel;
public static Item dragon_sword;
public static Item dragon_helmet;
public static Item dragon_chestplate;
public static Item dragon_leggings;
public static Item dragon_boots;
public static final Item.ToolMaterial dragonToolMaterial = EnumHelper.addToolMaterial("dragonToolMaterial", 3, 1561, 8.0F, 3.0F, 10);
public static final ItemArmor.ArmorMaterial dragonArmorMaterial = EnumHelper.addArmorMaterial("dragonArmorMaterial", null, 1561, new int[]{2,7,5,3}, 10);
public static void init() {
dragon_ingot = new Item().setUnlocalizedName("dragon_ingot").setCreativeTab(DragonRockMod.tabDragonRock);
bedrock_shard = new Item().setUnlocalizedName("bedrock_shard").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_pickaxe = new ItemDragonPickaxe(dragonToolMaterial).setUnlocalizedName("dragon_pickaxe").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_axe = new ItemDragonAxe(dragonToolMaterial).setUnlocalizedName("dragon_axe").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_shovel = new ItemDragonShovel(dragonToolMaterial).setUnlocalizedName("dragon_shovel").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_sword = new ItemDragonSword(dragonToolMaterial).setUnlocalizedName("dragon_sword").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_helmet = new ItemDragonArmour(dragonArmorMaterial, 0, 0).setUnlocalizedName("dragon_helmet").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_chestplate = new ItemDragonArmour(dragonArmorMaterial, 0, 1).setUnlocalizedName("dragon_chestplate").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_leggings = new ItemDragonArmour(dragonArmorMaterial, 0, 2).setUnlocalizedName("dragon_leggings").setCreativeTab(DragonRockMod.tabDragonRock);
dragon_boots = new ItemDragonArmour(dragonArmorMaterial, 0, 3).setUnlocalizedName("dragon_boots").setCreativeTab(DragonRockMod.tabDragonRock);
GameRegistry.addRecipe(new ItemStack(dragon_pickaxe), new Object[]{"DDD"," S "," S ", 'D', dragon_ingot, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(dragon_axe), new Object[]{"DD ","DS "," S ", 'D', dragon_ingot, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(dragon_shovel), new Object[]{" D "," S "," S ", 'D', dragon_ingot, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(dragon_sword), new Object[]{" D "," D "," S ", 'D', dragon_ingot, 'S', Items.stick});
GameRegistry.addRecipe(new ItemStack(dragon_helmet), new Object[]{"DDD","D D"," ", 'D', dragon_ingot});
GameRegistry.addRecipe(new ItemStack(dragon_chestplate), new Object[]{"D D","DDD","DDD", 'D', dragon_ingot});
GameRegistry.addRecipe(new ItemStack(dragon_leggings), new Object[]{"DDD","D D","D D", 'D', dragon_ingot});
GameRegistry.addRecipe(new ItemStack(dragon_boots), new Object[]{" ","D D","D D", 'D', dragon_ingot});
}
public static void register()
{
GameRegistry.registerItem(dragon_ingot, dragon_ingot.getUnlocalizedName().substring(5));
GameRegistry.registerItem(bedrock_shard, bedrock_shard.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_pickaxe, dragon_pickaxe.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_axe, dragon_axe.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_shovel, dragon_shovel.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_sword, dragon_sword.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_helmet, dragon_helmet.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_chestplate, dragon_chestplate.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_leggings, dragon_leggings.getUnlocalizedName().substring(5));
GameRegistry.registerItem(dragon_boots, dragon_boots.getUnlocalizedName().substring(5));
}
public static void registerRenders()
{
registerRender(dragon_ingot);
registerRender(bedrock_shard);
registerRender(dragon_pickaxe);
registerRender(dragon_axe);
registerRender(dragon_shovel);
registerRender(dragon_sword);
registerRender(dragon_helmet);
registerRender(dragon_chestplate);
registerRender(dragon_leggings);
registerRender(dragon_boots);
}
public static void registerRender(Item item)
{
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}
And the ItemDragonArmour class:
package metadestroyer.dragonrock.item;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
public class ItemDragonArmour extends ItemArmor {
public ItemDragonArmour(ArmorMaterial material, int renderIndex, int armorType) {
super(material, renderIndex, armorType);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if(this.armorType == 2)
{
return "drm:textures/models/armor/dragon_layer_2.png";
}
return "drm:textures/models/armor/dragon_layer_1.png";
}
}
Hope you can help me. And sorry if you think this is a waste of time because I'm starting with the mods. Thanks for your attention.
What went wrong? Was the texture not found? Was it not rendering on the armour properly? Are your textures in src/main/resources/assets/drm/textures/models/armor?
When posting code, please upload it to a site like Gist or Pastebin with syntax highlighting and link it here. It's much easier to read there.
Side note: Items and blocks should be instantiated and registered in the preInit phase. Recipes should be added in the init phase.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Well, the textures were in the right folder, the recipes work for me so don't worry about that and I'll use pastebin then. And the problem is that when I run the game and I put the armor on it appear as if I had no armor.
Are your armour textures in the same format as the vanilla textures?
If you specify the appropriate texture name in EnumHelper.addArmorMaterial, you don't need to override Item#getArmorTexture. Just use the format modid:name and it will be expanded to the appropriate path, e.g. modid:textures/models/armor/name_layer_1.png.
I just added a custom ArmorMaterial for my existing armour and gave it recoloured Chain armour textures and it works without issue (screenshot).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
What you have now should work if the textures are at the specified locations and in the same format as the vanilla textures.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I decided to test this myself and I can't reproduce the error.
I added one item that uses the vanilla Chain armour texture and another that uses a copy of it with a different name in my mod's resource domain. Both items display on the player just like the vanilla Chain armour.
You can see my code here. You can see screenshots here.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Yeah it's me again. Well, i was making armor for my mod and something went wrong when I tried to put the model armor textures to my mod. That's basically my problem.
These are my packages and clases:
And this is what I have in the two classes I have added the armor.
The DragonRockItems class:
And the ItemDragonArmour class:
Hope you can help me. And sorry if you think this is a waste of time because I'm starting with the mods. Thanks for your attention.
What went wrong? Was the texture not found? Was it not rendering on the armour properly? Are your textures in src/main/resources/assets/drm/textures/models/armor?
When posting code, please upload it to a site like Gist or Pastebin with syntax highlighting and link it here. It's much easier to read there.
Side note: Items and blocks should be instantiated and registered in the preInit phase. Recipes should be added in the init phase.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Well, the textures were in the right folder, the recipes work for me so don't worry about that and I'll use pastebin then. And the problem is that when I run the game and I put the armor on it appear as if I had no armor.
Are your armour textures in the same format as the vanilla textures?
If you specify the appropriate texture name in EnumHelper.addArmorMaterial, you don't need to override Item#getArmorTexture. Just use the format modid:name and it will be expanded to the appropriate path, e.g. modid:textures/models/armor/name_layer_1.png.
I just added a custom ArmorMaterial for my existing armour and gave it recoloured Chain armour textures and it works without issue (screenshot).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
But isn't there a way with the the classes I have?
What you have now should work if the textures are at the specified locations and in the same format as the vanilla textures.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ok, I'll see if that works.
I don't understand what the problem is with my classes.
If you change your Item#getArmorTexture implementation to return vanilla texture paths, does it display correctly?
If you replace your textures with vanilla textures and keep the existing paths, does it display correctly?
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
No
And I still don't know what the problem is.
So can someone help me? I don't understand what I need to do then.
I decided to test this myself and I can't reproduce the error.
I added one item that uses the vanilla Chain armour texture and another that uses a copy of it with a different name in my mod's resource domain. Both items display on the player just like the vanilla Chain armour.
You can see my code here. You can see screenshots here.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ok, sorry for wasting your time. I'll try that then.