хорошо, я пытаюсь переписать обычную броню из Minecraft, поэтому мне нужно отменить рендеринг брони из обычного Minecraft, но он все еще показывает старую броню ...
это выглядит так: this (я не хочу, чтобы он отображал "большую" броню)
и вот код, который я использую:
package com.bnhc.items;
import com.bnhc.client.render.CArmour;
import com.bnhc.main.Main;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class CCloth extends ItemArmor {
public CCloth(ArmorMaterial material, int armorType, int armorIndex) {
super(material, armorType, armorIndex);
}
public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String layer) {
if(((itemstack.getItem() == MIte.ua_sports_layer_1) || (itemstack.getItem() == MIte.ua_sports_layer_1))){
return "bnhc:textures/armour/uasports_layer_1.png";
}
return null;
}
CArmour armorModel = new CArmour(0.0F);
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if (itemStack != null) {
if (itemStack.getItem() instanceof CCloth) {
int type = ((ItemArmor)itemStack.getItem()).armorType;
if (type == 1) {
armorModel = Main.proxy.getArmorModel(0);
} else {
armorModel = Main.proxy.getArmorModel(1);
}
}
if (armorModel != null) {
armorModel.isSneak = entityLiving.isSneaking();
armorModel.isRiding = entityLiving.isRiding();
armorModel.isChild = entityLiving.isChild();
armorModel.heldItemRight = entityLiving.getEquipmentInSlot(0) != null ? 1 :0;
if(entityLiving instanceof EntityPlayer) {
armorModel.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2;
}
return armorModel;
}
}
return armorModel;
}
}
и это в моем клиентском прокси-сервере:
@Override
public CArmour getArmorModel(int id) {
return customArmour;
}
-edit хорошо, я все заработал .. в основном, что я сделал не так, так это то, что он уже отображается по умолчанию, делая его ModelBiped (пожалуйста, поправьте меня, если я ошибаюсь) так что все, что мне нужно было сделать, это удалить прокси-сервер клиента ...
вот так это выглядит сейчас ( исправленная версия ):
package com.bnhc.items;
import com.bnhc.CreativeTabs.CTBS;
import com.bnhc.main.Ref;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class CCloth extends ItemArmor {
public CCloth(ArmorMaterial armorMaterial, int renderindex, int armortype,String name) {
super(armorMaterial, renderindex, armortype);
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if(stack.getItem() == MIte.ua_sports_chest) {
return Ref.MODID+ ":textures/armour/uasports_layer_1.png";
}else if(stack.getItem() == MIte.ua_sports_leggs){
return Ref.MODID+ ":textures/armour/uasports_layer_2.png";
}else {
return null;
}
}
ModelBiped armorModel = new ModelBiped();
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving,
ItemStack itemStack, int armorSlot) {
if(itemStack != null){
if(armorModel != null){
armorModel.bipedRightLeg.showModel = armorSlot == 2;
armorModel.bipedLeftLeg.showModel = armorSlot == 2;
armorModel.bipedBody.showModel = armorSlot == 1;
armorModel.bipedRightArm.showModel = armorSlot == 1;
armorModel.bipedLeftArm.showModel = armorSlot == 1;
armorModel.bipedHead.showModel = armorSlot == 0;
armorModel.isSneak = entityLiving.isSneaking();
armorModel.isRiding = entityLiving.isRiding();
armorModel.isChild = entityLiving.isChild();
armorModel.heldItemRight = entityLiving.getEquipmentInSlot(0) != null ? 1 :0;
if(entityLiving instanceof EntityPlayer){
armorModel.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2;
}
return armorModel;
}
}
return armorModel;
}
}
я удалил свои вещи в клиентском прокси, потому что они не нужны в аннотации @SideOnly, и обработал их 2 раза ..