У меня крашается майн, когда я регаю модель на клиентпрокси.
Вот код:
Вот код:
Код:
//ИТЕМ
package ru.tiaryy.manual;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
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.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
public class BandK extends ItemArmor{
public BandK(int id, int armorType) {
super(ArmorMaterial.DIAMOND, id, armorType); //Материал
this.setCreativeTab(CreativeTabs.tabCombat);
this.setMaxStackSize(1);
this.setTextureName("PicJ"); //Текстурка итема
}
@Override
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon("blocklol" + ":PicJ"); //Текстурка итема
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
String type) {
return "%s:textures/models/Bandpnp_konokha.png"; //текстурка брони на игроке
}
ModelBiped Wapka = new ModelBiped(); //вместо Wapka называем как хотим
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving,
ItemStack itemStack, int armorSlot) {
if(itemStack != null){
if(itemStack.getItem() instanceof BandK){
int type = ((ItemArmor)itemStack.getItem()).armorType;
Wapka = main.proxy.getArmorModel4(0);
}
if(Wapka != null){
Wapka.bipedHead.showModel = armorSlot == 2;
Wapka.bipedHeadwear.showModel = armorSlot == 10;
Wapka.bipedBody.showModel = armorSlot == 4 || armorSlot == 4;
Wapka.bipedRightArm.showModel = armorSlot == 2;
Wapka.bipedLeftArm.showModel = armorSlot == 1;
Wapka.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3;
Wapka.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3;
Wapka.isSneak = entityLiving.isSneaking();
Wapka.isRiding = entityLiving.isRiding();
Wapka.isChild = entityLiving.isChild();
if(entityLiving instanceof EntityPlayer){
Wapka.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2;
}
}
}
return Wapka;
}
}
Код:
//ClientProxy
package ru.tiaryy.manual;
import net.minecraft.client.model.ModelBiped;
import ru.tiaryy.manual.CommonProxy;
public class ClientProxy
extends CommonProxy {
public static ModelBiped getArmorModel1() {
// TODO Auto-generated method stub
return null;
}
public static ModelBiped getArmorModel6() {
// TODO Auto-generated method stub
return null;
}
private static final ModelSusano Susano = new ModelSusano(-1.0F);
@Override
public ModelBiped getArmorModel1(int id){
return Susano;
}
private static final ModelSusanoM SusanoM = new ModelSusanoM(-1.0F);
@Override
public ModelBiped getArmorModel7(int id){
return SusanoM;
}
private static final ModelOtwelnik kkk = new ModelOtwelnik(-1.0F);
@Override
public ModelBiped getArmorModel2(int id){
return kkk;
}
}
Код:
//Модель
package ru.tiaryy.manual;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelBandK
extends ModelBiped
{
ModelRenderer Shape1;
ModelRenderer Shape10;
ModelRenderer Shape11;
ModelRenderer Shape12;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;
ModelRenderer Shape5;
ModelRenderer Shape6;
ModelRenderer Shape7;
ModelRenderer Shape8;
ModelRenderer Shape9;
public ModelBandK (float f)
{
textureWidth = 64;
textureHeight = 32;
Shape1.mirror = true;
Shape1 = new ModelRenderer(this, 34, 12);
Shape1.addBox(0F, 0F, 0F, 8, 2, 1);
Shape1.setRotationPoint(-4F, -7F, 3.3F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
Shape1.mirror = false;
Shape10.mirror = true;
Shape10 = new ModelRenderer(this, 34, 0);
Shape10.addBox(0F, 0F, -1F, 8, 2, 1);
Shape10.setRotationPoint(-3.3F, -7F, 4F);
Shape10.setTextureSize(64, 32);
Shape10.mirror = true;
setRotation(Shape10, 0F, 1.56207F, 0F);
Shape10.mirror = false;
Shape11.mirror = true;
Shape11 = new ModelRenderer(this, 34, 8);
Shape11.addBox(0F, 0F, 0F, 8, 2, 1);
Shape11.setRotationPoint(3.3F, -7F, 4F);
Shape11.setTextureSize(64, 32);
Shape11.mirror = true;
setRotation(Shape11, 0F, 1.579523F, 0F);
Shape11.mirror = false;
Shape12.mirror = true;
Shape12 = new ModelRenderer(this, 34, 4);
Shape12.addBox(0F, 0F, 0F, 8, 2, 1);
Shape12.setRotationPoint(-4F, -7F, -4.3F);
Shape12.setTextureSize(64, 32);
Shape12.mirror = true;
setRotation(Shape12, 0F, 0F, 0F);
Shape12.mirror = false;
Shape2.mirror = true;
Shape2 = new ModelRenderer(this, 54, 0);
Shape2.addBox(0F, 0F, 0F, 4, 2, 1);
Shape2.setRotationPoint(-2F, -7.1F, 3.5F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape2.mirror = false;
Shape3.mirror = true;
Shape3 = new ModelRenderer(this, 59, 10);
Shape3.addBox(0F, 0F, 0F, 1, 2, 1);
Shape3.setRotationPoint(3.3F, -7F, 3.3F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
Shape3.mirror = false;
Shape4.mirror = true;
Shape4 = new ModelRenderer(this, 59, 14);
Shape4.addBox(0F, 0F, 0F, 1, 2, 1);
Shape4.setRotationPoint(-4.3F, -7F, 3.3F);
Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
setRotation(Shape4, 0F, 0F, 0F);
Shape4.mirror = false;
Shape5.mirror = true;
Shape5 = new ModelRenderer(this, 59, 18);
Shape5.addBox(0F, 0F, 0F, 1, 2, 1);
Shape5.setRotationPoint(-4.2F, -7F, -4.3F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
Shape5.mirror = false;
Shape6.mirror = true;
Shape6 = new ModelRenderer(this, 53, 5);
Shape6.addBox(0F, 0F, 0F, 1, 2, 1);
Shape6.setRotationPoint(3.3F, -7F, -4.3F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
Shape6.mirror = false;
Shape7.mirror = true;
Shape7 = new ModelRenderer(this, 59, 28);
Shape7.addBox(0F, 0F, 0F, 1, 2, 1);
Shape7.setRotationPoint(-0.5F, -7F, -4.5F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
Shape7.mirror = false;
Shape8.mirror = true;
Shape8 = new ModelRenderer(this, 59, 22);
Shape8.addBox(0F, 0F, 0F, 1, 4, 1);
Shape8.setRotationPoint(-0.5F, -6F, -4.5F);
Shape8.setTextureSize(64, 32);
Shape8.mirror = true;
setRotation(Shape8, 0F, 0F, -0.5410521F);
Shape8.mirror = false;
Shape9.mirror = true;
Shape9 = new ModelRenderer(this, 53, 9);
Shape9.addBox(-1F, 0F, 0F, 1, 5, 1);
Shape9.setRotationPoint(0.5F, -6F, -4.5F);
Shape9.setTextureSize(64, 32);
Shape9.mirror = true;
setRotation(Shape9, 0F, 0F, 0.3490659F);
Shape9.mirror = false;
this.bipedHead.addChild(Shape1);
this.bipedHead.addChild(Shape10);
this.bipedHead.addChild(Shape11);
this.bipedHead.addChild(Shape12);
this.bipedHead.addChild(Shape2);
this.bipedHead.addChild(Shape3);
this.bipedHead.addChild(Shape4);
this.bipedHead.addChild(Shape5);
this.bipedHead.addChild(Shape6);
this.bipedHead.addChild(Shape7);
this.bipedHead.addChild(Shape8);
this.bipedHead.addChild(Shape9);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity Entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, Entity);
}
}