- 3
- 0
Здравствуйте, возникла проблема с отображением своей брони на 1.5.2.
При тестах в Eclipse всё нормально, однако при установке в сборку с другими модами возникает проблема - не отображаются предметы/блоки/броня из других модов. С моего же мода вся броня отображается.
Полагаю проблема в указании отображаемой брони в RenderPlayer.armorFilenamePrefix, но не совсем понимаю, как просто добавлять свою броню, не исключая остальные.
Класс Брони
Объявление брони в главном классе
ClientProxy
CommonProxy
При тестах в Eclipse всё нормально, однако при установке в сборку с другими модами возникает проблема - не отображаются предметы/блоки/броня из других модов. С моего же мода вся броня отображается.
Полагаю проблема в указании отображаемой брони в RenderPlayer.armorFilenamePrefix, но не совсем понимаю, как просто добавлять свою броню, не исключая остальные.
Класс Брони
Java:
public class NGArmor extends ItemArmor implements IArmorTextureProvider {
private static int[] damageReductionAmountArray = new int[] { 13, 25, 20, 15 };
private int damageReduceAmount;
public NGArmor(int i, int j) {
super(i, EnumArmorMaterial.CHAIN, 5, j);
damageReduceAmount = damageReductionAmountArray[j];
setMaxDamage(100000);
}
public void registerIcons(IconRegister par1IconRegister) {
if (this == AllItems.NGhelm) {
this.itemIcon = par1IconRegister.registerIcon("anotherpack:armor/itemArmorNanoHelmet");
}
if (this == AllItems.NGplate) {
this.itemIcon = par1IconRegister.registerIcon("anotherpack:armor/itemArmorNanoChestplate");
}
if (this == AllItems.NGlegs) {
this.itemIcon = par1IconRegister.registerIcon("anotherpack:armor/itemArmorNanoLegs");
}
if (this == AllItems.NGboots) {
this.itemIcon = par1IconRegister.registerIcon("anotherpack:armor/itemArmorNanoBoots");
;
}
return;
}
@Override
public String getArmorTextureFile(ItemStack itemstack) {
if (itemstack.itemID == AllItems.NGhelm.itemID || itemstack.itemID == AllItems.NGplate.itemID
|| itemstack.itemID == AllItems.NGboots.itemID) {
return "/mods/anotherpack/textures/armor/NGArmor_1.png";
}
if (itemstack.itemID == AllItems.NGlegs.itemID) {
return "/mods/anotherpack/textures/armor/NGArmor_2.png";
}
else
return null;
}
}
Объявление брони в главном классе
Java:
public static Item NGhelm = new NGArmor(1658, 0).setUnlocalizedName("NGhelm");
public static Item NGplate = new NGArmor(1659, 1).setUnlocalizedName("NGplate");
public static Item NGlegs = new NGArmor(1660, 2)..setUnlocalizedName("NGlegs");
public static Item NGboots = new NGArmor(1661, 3)..setUnlocalizedName("NGboots");
ClientProxy
Java:
public class ClientProxy extends CommonProxy {
@Override
public void initMod() {
super.initMod();
RenderingRegistry.registerBlockHandler(AllBlocks.renderIngotPyramidID, new IngotPyramidHandler());
RenderPlayer.armorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold", "NGArmor"};
}
}
CommonProxy
Java:
public class CommonProxy implements IGuiHandler {
public void preInit(FMLPreInitializationEvent e) {
}
public void init(FMLInitializationEvent e) {
}
public void initMod() {
}
public void postInit() {
}
public void registerRenderInformation() {}
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;
}
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;
}
public void registerTiles() {}
public void registerItems() {}
}
Последнее редактирование модератором: