我制作的mod(Clothes.png和Clothes2.png)中的盔甲模型/纹理没有显示,而是得到了一个普通的铁甲模型。这是为什么?这是我的代码:
package com.example.AoT;
import javax.swing.text.html.parser.Entity;
import scala.tools.nsc.MainClass;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
public class ArmorTC extends ItemArmor{
public ArmorTC(int i, ArmorMaterial armorTC, int id, int placement) {
super(armorTC, id, placement);
setCreativeTab(CreativeTabs.tabCombat);
if (placement == 1){
this.setTextureName(AoT.MODID + ":TrainingCorpsJacket");
}
else if (placement == 2){
this.setTextureName(AoT.MODID + ":TrainingCorpsTrousers");
}
else if (placement == 3){
this.setTextureName(AoT.MODID + ":TrainingCorpsBoots");
}
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if (stack.getItem() == AoT.TrainingCorpsJacket || stack.getItem() == AoT.TrainingCorpsBoots) {
return AoT.MODID + ":textures/models/armor/Clothes.png";
}
if (stack.getItem() == AoT.TrainingCorpsTrousers) {
return AoT.MODID + ":textures/models/armor/Clothes2.png";
} else {
return null;
}
}
}
更新了部分代码(我在调试器中的.itemID处遇到错误,我应该在那里键入其他内容吗?)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if (stack.getItem().itemID == AoT.TrainingCorpsJacket.itemID || stack.getItem().itemID == AoT.TrainingCorpsBoots.itemID) {
return AoT.MODID + ":textures/models/armor/clothes.png";
}
if (stack.getItem().itemID == AoT.TrainingCorpsTrousers.itemID) {
return AoT.MODID + ":textures/models/armor/clothes2.png";
} else {
return null;