[1.7.10]Броня

34
0
Вот,не отображается моделька брони,
Вот класс модельки:
Код:
package com.armor.client.models;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;

public class ModelHeadArmor3 extends ModelBiped
{
  //fields
    ModelRenderer Shape0;
    ModelRenderer Shape1;
    ModelRenderer Shape2;
    ModelRenderer Shape3;
    ModelRenderer Shape4;
    ModelRenderer Shape5;
    ModelRenderer Shape6;
    ModelRenderer Shape7;
    ModelRenderer Shape8;
    ModelRenderer Shape9;
    ModelRenderer Shape10;
    ModelRenderer Shape11;
    ModelRenderer Shape12;
    ModelRenderer Shape13;
    ModelRenderer Shape14;
    ModelRenderer Shape15;
    ModelRenderer Shape16;
    ModelRenderer Shape17;
    ModelRenderer Shape18;
    ModelRenderer Shape19;
    ModelRenderer Shape20;
    ModelRenderer Shape21;
    ModelRenderer Shape22;
  
  public ModelHeadArmor3(float f)
  {
    textureWidth = 512;
    textureHeight = 512;
    
      Shape0 = new ModelRenderer(this, 1, 1);
      Shape0.addBox(0F, 0F, 0F, 8, 3, 4);
      Shape0.setRotationPoint(-4F, 10F, -2F);
      Shape0.setTextureSize(512, 512);
      Shape0.mirror = true;
      setRotation(Shape0, 0F, 0F, 0F);
      Shape1 = new ModelRenderer(this, 1, 9);
      Shape1.addBox(0F, 0F, 0F, 8, 8, 1);
      Shape1.setRotationPoint(-4F, 2F, -2.5F);
      Shape1.setTextureSize(512, 512);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      Shape2 = new ModelRenderer(this, 1, 1);
      Shape2.addBox(0F, 0F, 0F, 2, 3, 1);
      Shape2.setRotationPoint(-4.5F, 0F, -2.5F);
      Shape2.setTextureSize(512, 512);
      Shape2.mirror = true;
      setRotation(Shape2, 0F, 0F, -0.1919862F);
      Shape3 = new ModelRenderer(this, 1, 1);
      Shape3.addBox(0F, 0F, 0F, 2, 4, 1);
      Shape3.setRotationPoint(2.5F, -1F, -2.5F);
      Shape3.setTextureSize(512, 512);
      Shape3.mirror = true;
      setRotation(Shape3, 0F, 0F, 0.1919862F);
      Shape4 = new ModelRenderer(this, 1, 9);
      Shape4.addBox(0F, 0F, 0F, 8, 10, 1);
      Shape4.setRotationPoint(-4F, 0F, 1.5F);
      Shape4.setTextureSize(512, 512);
      Shape4.mirror = true;
      setRotation(Shape4, 0F, 0F, 0F);
      Shape5 = new ModelRenderer(this, 1, 1);
      Shape5.addBox(0F, 0F, 0F, 8, 3, 1);
      Shape5.setRotationPoint(-4F, 2F, -2.5F);
      Shape5.setTextureSize(512, 512);
      Shape5.mirror = true;
      setRotation(Shape5, -0.1570796F, 0F, 0F);
      Shape6 = new ModelRenderer(this, 1, 1);
      Shape6.addBox(0F, 0F, 0F, 8, 3, 1);
      Shape6.setRotationPoint(-4F, 5F, -2.5F);
      Shape6.setTextureSize(512, 512);
      Shape6.mirror = true;
      setRotation(Shape6, -0.1570796F, 0F, 0F);
      Shape7 = new ModelRenderer(this, 1, 1);
      Shape7.addBox(0F, 0F, 0F, 8, 4, 1);
      Shape7.setRotationPoint(-4F, 8F, -2.5F);
      Shape7.setTextureSize(512, 512);
      Shape7.mirror = true;
      setRotation(Shape7, -0.1570796F, 0F, 0F);
      Shape8 = new ModelRenderer(this, 1, 1);
      Shape8.addBox(0F, 0F, 0F, 8, 3, 1);
      Shape8.setRotationPoint(-4F, 0F, -2.5F);
      Shape8.setTextureSize(512, 512);
      Shape8.mirror = true;
      setRotation(Shape8, -0.2617994F, 0F, 0F);
      Shape9 = new ModelRenderer(this, 1, 1);
      Shape9.addBox(0F, 0F, 0F, 8, 3, 1);
      Shape9.setRotationPoint(-4F, 0F, 2.1F);
      Shape9.setTextureSize(512, 512);
      Shape9.mirror = true;
      setRotation(Shape9, 0.2617994F, 0F, 0F);
      Shape10 = new ModelRenderer(this, 1, 1);
      Shape10.addBox(0F, 0F, 0F, 8, 3, 1);
      Shape10.setRotationPoint(-4F, 3F, 2.1F);
      Shape10.setTextureSize(512, 512);
      Shape10.mirror = true;
      setRotation(Shape10, 0.2617994F, 0F, 0F);
      Shape11 = new ModelRenderer(this, 1, 1);
      Shape11.addBox(0F, 0F, 0F, 8, 3, 1);
      Shape11.setRotationPoint(-4F, 6F, 2.1F);
      Shape11.setTextureSize(512, 512);
      Shape11.mirror = true;
      setRotation(Shape11, 0.2617994F, 0F, 0F);
      Shape12 = new ModelRenderer(this, 1, 9);
      Shape12.addBox(0F, 0F, 0F, 8, 3, 1);
      Shape12.setRotationPoint(-4F, 9F, 2.1F);
      Shape12.setTextureSize(512, 512);
      Shape12.mirror = true;
      setRotation(Shape12, 0.2617994F, 0F, 0F);
      Shape13 = new ModelRenderer(this, 1, 1);
      Shape13.addBox(0F, 0F, 0F, 1, 4, 6);
      Shape13.setRotationPoint(-8F, -1F, -3F);
      Shape13.setTextureSize(512, 512);
      Shape13.mirror = true;
      setRotation(Shape13, 0F, 0F, 0.2792527F);
      Shape14 = new ModelRenderer(this, 1, 1);
      Shape14.addBox(0F, 0F, 0F, 4, 4, 6);
      Shape14.setRotationPoint(-8F, -1F, -3F);
      Shape14.setTextureSize(512, 512);
      Shape14.mirror = true;
      setRotation(Shape14, 0F, 0F, 0F);
      Shape15 = new ModelRenderer(this, 1, 1);
      Shape15.addBox(0F, 0F, 0F, 1, 4, 6);
      Shape15.setRotationPoint(-8F, 3F, -3F);
      Shape15.setTextureSize(512, 512);
      Shape15.mirror = true;
      setRotation(Shape15, 0F, 0F, 0.2792527F);
      Shape16 = new ModelRenderer(this, 1, 1);
      Shape16.addBox(0F, 0F, 0F, 1, 4, 6);
      Shape16.setRotationPoint(-8F, 6F, -3F);
      Shape16.setTextureSize(512, 512);
      Shape16.mirror = true;
      setRotation(Shape16, 0F, 0F, 0.2792527F);
      Shape17 = new ModelRenderer(this, 1, 1);
      Shape17.addBox(0F, 0F, 0F, 4, 7, 4);
      Shape17.setRotationPoint(-8F, 3F, -2F);
      Shape17.setTextureSize(512, 512);
      Shape17.mirror = true;
      setRotation(Shape17, 0F, 0F, 0F);
      Shape18 = new ModelRenderer(this, 1, 1);
      Shape18.addBox(0F, 0F, 0F, 4, 4, 6);
      Shape18.setRotationPoint(4F, -1F, -3F);
      Shape18.setTextureSize(512, 512);
      Shape18.mirror = true;
      setRotation(Shape18, 0F, 0F, 0F);
      Shape19 = new ModelRenderer(this, 1, 1);
      Shape19.addBox(0F, 0F, 0F, 1, 4, 6);
      Shape19.setRotationPoint(7F, 6.3F, -3F);
      Shape19.setTextureSize(512, 512);
      Shape19.mirror = true;
      setRotation(Shape19, 0F, 0F, -0.2792527F);
      Shape20 = new ModelRenderer(this, 1, 1);
      Shape20.addBox(0F, 0F, 0F, 1, 4, 6);
      Shape20.setRotationPoint(7F, -0.7F, -3F);
      Shape20.setTextureSize(512, 512);
      Shape20.mirror = true;
      setRotation(Shape20, 0F, 0F, -0.2792527F);
      Shape21 = new ModelRenderer(this, 1, 1);
      Shape21.addBox(0F, 0F, 0F, 1, 4, 6);
      Shape21.setRotationPoint(7F, 2.3F, -3F);
      Shape21.setTextureSize(512, 512);
      Shape21.mirror = true;
      setRotation(Shape21, 0F, 0F, -0.2792527F);
      Shape22 = new ModelRenderer(this, 1, 1);
      Shape22.addBox(0F, 0F, 0F, 4, 7, 4);
      Shape22.setRotationPoint(4F, 3F, -2F);
      Shape22.setTextureSize(512, 512);
      Shape22.mirror = true;
      setRotation(Shape22, 0F, 0F, 0F);
      
      this.bipedRightArm.addChild(Shape17);
      this.bipedBody.addChild(Shape0);
    
  }
  
  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 e)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, e);
  }

    

}
Вот класс брони:
Код:
package com.armor.common.items;



import OnePieceCraft.Djay.Main;
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.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;

public class CustomArmor3 extends ItemArmor{

    

    public CustomArmor3(int id, int armorType) {
        super(ArmorMaterial.DIAMOND, id, armorType);       //Материал
        this.setCreativeTab(CreativeTabs.tabCombat);                                      
        this.setMaxStackSize(1);
        this.setTextureName("Test");        //Текстурка итема               
    }
    
    

@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
String type) {
        return "mod:textures/models/armor/ArmorModel.png";     //текстурка брони на игроке
}
ModelBiped ModelHeadArmor3 = new ModelBiped();//вместо PartyHat называем как хотим
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving,
ItemStack itemStack, int armorSlot) {
if(itemStack != null){
if(itemStack.getItem() instanceof CustomArmor3){
int type = ((ItemArmor)itemStack.getItem()).armorType;
ModelHeadArmor3 = Main.proxy.getArmorModel(1);   
//TestMOD-ваш гл класс, proxy - это переменная с сервер прокси [пример: public static ServerProxy proxy1;] 
//Все это,это регистрация модели в прокси .Где (0) это тип брони. 1-нагрудник, 2 - штаны , 3 - ботинки

}
if(ModelHeadArmor3 != null){
    ModelHeadArmor3.bipedHead.showModel = armorSlot == 0;
    ModelHeadArmor3.bipedHeadwear.showModel = armorSlot == 10;
    ModelHeadArmor3.bipedBody.showModel = armorSlot == 2 || armorSlot == 2;
    ModelHeadArmor3.bipedRightArm.showModel = armorSlot == 2;
    ModelHeadArmor3.bipedLeftArm.showModel = armorSlot == 2;
    ModelHeadArmor3.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3;
    ModelHeadArmor3.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3;
    ModelHeadArmor3.isSneak = entityLiving.isSneaking();
    ModelHeadArmor3.isRiding = entityLiving.isRiding();
    ModelHeadArmor3.isChild = entityLiving.isChild();
if(entityLiving instanceof EntityPlayer){
    ModelHeadArmor3.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2;
}
}
}
return ModelHeadArmor3;
}
}
 
34
0
AlexSocol написал(а):
Ну может ты где-то в ClientProxy её не зарегал или ещё что
Код:
public class ClientProxy extends CommonProxy {

    
    private static final ModelHeadArmor3 tutChest = new ModelHeadArmor3(1.0F);
    @Override
    public ModelBiped getArmorModel(int id){
    return tutChest;
    
}
}
 
Сверху