Whyneb360 Posted November 8, 2014 Share Posted November 8, 2014 Hello again everyone, I've taken a break from my armour modelling, but I have come back to it ready to make it work. As it stands, the model mostly works, but there are a couple of bits in the wrong places (for no reason I could figure out - not the rotation point) and the textures are being very weird Here are some pics(Click on them to see the full thing): http://elemental-imperium.wikia.com/wiki/Temp_Files As you can see, some of the textures are messed up especially on the head and legs, and bits of the helmet and shoes are a bit wonky. Here is my code also: Armour-Model Class: public class ElementalArmor extends ItemArmor{ public ElementalArmor(ArmorMaterial var1, int var2, int var3) { super(var1, var2, var3); } @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { ModelBiped armorModel = null; if(itemStack != null){ if(itemStack.getItem() instanceof ElementalArmor){ int type = ((ItemArmor)itemStack.getItem()).armorType; if(type == 0) { armorModel = ElementalImperium.proxy.getArmorModel(0); } if(type == 1) { armorModel = ElementalImperium.proxy.getArmorModel(1); } if(type == 2) { armorModel = ElementalImperium.proxy.getArmorModel(2); } if(type == 3) { armorModel = ElementalImperium.proxy.getArmorModel(3); } } if(armorModel != null) { armorModel.bipedHead.showModel = armorSlot == 0; armorModel.bipedHeadwear.showModel = armorSlot == 0; armorModel.bipedBody.showModel = armorSlot == 1 || armorSlot == 2; armorModel.bipedRightArm.showModel = armorSlot == 1; armorModel.bipedLeftArm.showModel = armorSlot == 1; armorModel.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3; armorModel.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3; armorModel.isSneak = entityLiving.isSneaking(); armorModel.isRiding = entityLiving.isRiding(); armorModel.isChild = entityLiving.isChild(); if(entityLiving instanceof EntityPlayer) { armorModel.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2; } } } return armorModel; } @Override public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String type) { if(itemstack != null) { if(itemstack.getItem() instanceof ElementalArmor) { int type1 = ((ItemArmor)itemstack.getItem()).armorType; if(type1 == 0) { return Constants.MODID + ":textures/armor/policeArmorHelmet.png"; } if(type1 == 1) { return Constants.MODID + ":textures/armor/policeArmorChest.png"; } if(type1 == 2) { return null; } if(type1 == 3) { return Constants.MODID + ":textures/armor/policeArmorBoots.png"; } } } return null; } } ClientProxy: private static final ModelRCPHelmet Helmet = new ModelRCPHelmet(1.3f); private static final ModelRCPChest Chest = new ModelRCPChest(1.0f); private static final ModelRCPChest Legs = new ModelRCPChest(0.5f); private static final ModelRCPBoots Boots = new ModelRCPBoots(1.0f); @Override public ModelBiped getArmorModel(int id) { switch (id) { case 0: return Helmet; case 1: return Chest; case 2: return Legs; case 3: return Boots; default: break; } return null; } } Helmet: public class ModelRCPHelmet extends ModelBiped { //fields 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; public ModelRCPHelmet(float f) { textureWidth = 64; textureHeight = 32; shape1 = new ModelRenderer(this, 42, 13); shape1.addBox(4.5F, -7.3F, -4.9F, 1, 8, 9); shape1.setRotationPoint(0F, 0F, 0F); shape1.setTextureSize(64, 32); shape1.mirror = true; setRotation(shape1, 0F, 0F, -0.1791871F); this.bipedHead.addChild(shape1); shape2 = new ModelRenderer(this, 42, 13); shape2.addBox(-5.5F, -7.3F, -4.9F, 1, 8, 9); shape2.setRotationPoint(0F, 0F, 0F); shape2.setTextureSize(64, 32); shape2.mirror = true; setRotation(shape2, 0F, 0F, 0.1826778F); this.bipedHead.addChild(shape2); shape3 = new ModelRenderer(this, 4, 13); shape3.addBox(-4.5F, -8F, -4.5F, 9, 1, 9); shape3.setRotationPoint(0F, 0F, 0F); shape3.setTextureSize(64, 32); shape3.mirror = true; setRotation(shape3, 0F, 0F, 0F); this.bipedHead.addChild(shape3); shape4 = new ModelRenderer(this, 7, 24); shape4.addBox(4F, -6.1F, 3.7F, 1, 7, 1); shape4.setRotationPoint(0F, 0F, 0F); shape4.setTextureSize(64, 32); shape4.mirror = true; setRotation(shape4, 0.1128646F, -1.583595F, -0.1477712F); this.bipedHead.addChild(shape4); shape5 = new ModelRenderer(this, 2, 24); shape5.addBox(3.8F, -6.1F, 3.7F, 1, 7, 1); shape5.setRotationPoint(0F, 0F, 0F); shape5.setTextureSize(64, 32); shape5.mirror = true; setRotation(shape5, 0.1128646F, 0F, -0.1245002F); this.bipedHead.addChild(shape5); shape6 = new ModelRenderer(this, 52, 1); shape6.addBox(-2F, -6F, -9F, 4, 1, 1); shape6.setRotationPoint(0F, 0F, 0F); shape6.setTextureSize(64, 32); shape6.mirror = true; setRotation(shape6, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape6); shape7 = new ModelRenderer(this, 58, 1); shape7.addBox(-1.5F, -5.2F, -9F, 1, 1, 1); shape7.setRotationPoint(0F, 0F, 0F); shape7.setTextureSize(64, 32); shape7.mirror = true; setRotation(shape7, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape7); shape8 = new ModelRenderer(this, 58, 1); shape8.addBox(0.5F, -5.2F, -9F, 1, 1, 1); shape8.setRotationPoint(0F, 0F, 0F); shape8.setTextureSize(64, 32); shape8.mirror = true; setRotation(shape8, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape8); shape9 = new ModelRenderer(this, 52, 1); shape9.addBox(-2F, -4.5F, -9F, 1, 1, 1); shape9.setRotationPoint(0F, 0F, 0F); shape9.setTextureSize(64, 32); shape9.mirror = true; setRotation(shape9, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape9); shape10 = new ModelRenderer(this, 55, 1); shape10.addBox(-1.5F, -3.8F, -9F, 1, 1, 1); shape10.setRotationPoint(0F, 0F, 0F); shape10.setTextureSize(64, 32); shape10.mirror = true; setRotation(shape10, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape10); shape11 = new ModelRenderer(this, 52, 1); shape11.addBox(1F, -4.5F, -9F, 1, 1, 1); shape11.setRotationPoint(0F, 0F, 0F); shape11.setTextureSize(64, 32); shape11.mirror = true; setRotation(shape11, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape11); shape12 = new ModelRenderer(this, 6, 13); shape12.addBox(-4F, -9.5F, -4F, 8, 1, ; shape12.setRotationPoint(0F, 0F, 0F); shape12.setTextureSize(64, 32); shape12.mirror = true; setRotation(shape12, 0F, 0F, 0F); this.bipedHead.addChild(shape12); shape13 = new ModelRenderer(this, 4, 13); shape13.addBox(-4.5F, -9F, -4.5F, 9, 1, 9); shape13.setRotationPoint(0F, 0F, 0F); shape13.setTextureSize(64, 32); shape13.mirror = true; setRotation(shape13, 0F, 0F, 0F); this.bipedHead.addChild(shape13); shape14 = new ModelRenderer(this, 44, 5); shape14.addBox(-2.5F, -9F, -0.5F, 5, 1, 4); shape14.setRotationPoint(0F, 0F, 0F); shape14.setTextureSize(64, 32); shape14.mirror = true; setRotation(shape14, 0.6981317F, 0F, 0F); this.bipedHead.addChild(shape14); shape15 = new ModelRenderer(this, 53, 1); shape15.addBox(0.5F, -3.8F, -9F, 1, 1, 1); shape15.setRotationPoint(0F, 0F, 0F); shape15.setTextureSize(64, 32); shape15.mirror = true; setRotation(shape15, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape15); shape16 = new ModelRenderer(this, 23, 24); shape16.addBox(-4F, -6.5F, 4.5F, 8, 7, 1); shape16.setRotationPoint(0F, 0F, 0F); shape16.setTextureSize(64, 32); shape16.mirror = true; setRotation(shape16, 0.1628974F, 0F, 0F); this.bipedHead.addChild(shape16); shape17 = new ModelRenderer(this, 0, 0); shape17.addBox(-5F, -8.5F, -5F, 10, 1, 10); shape17.setRotationPoint(0F, 0F, 0F); shape17.setTextureSize(64, 32); shape17.mirror = true; setRotation(shape17, 0F, 0F, 0F); this.bipedHead.addChild(shape17); } 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); } } Boots: public class ModelRCPBoots extends ModelBiped { //fields ModelRenderer shape1; ModelRenderer shape2; ModelRenderer shape3; ModelRenderer shape4; ModelRenderer shape5; ModelRenderer shape6; ModelRenderer shape7; ModelRenderer shape8; public ModelRCPBoots(float f) { textureWidth = 64; textureHeight = 32; shape1 = new ModelRenderer(this, 1, 22); shape1.addBox(-2.7F, 9F, -2.8F, 5, 3, 6); shape1.setRotationPoint(0F, 0F, 0F); shape1.setTextureSize(64, 32); shape1.mirror = true; setRotation(shape1, 0F, 0F, 0F); this.bipedRightLeg.addChild(shape1); shape2 = new ModelRenderer(this, 1, 12); shape2.addBox(-2.3F, 9F, -2.8F, 5, 3, 6); shape2.setRotationPoint(0F, 0F, 0F); shape2.setTextureSize(64, 32); shape2.mirror = true; setRotation(shape2, 0F, 0F, 0F); this.bipedLeftLeg.addChild(shape2); shape3 = new ModelRenderer(this, 24, 13); shape3.addBox(-1.5F, 7.5F, -3F, 3, 2, 1); shape3.setRotationPoint(0F, 0F, 0F); shape3.setTextureSize(64, 32); shape3.mirror = true; setRotation(shape3, 0F, 0F, 0F); this.bipedRightLeg.addChild(shape3); shape4 = new ModelRenderer(this, 24, 13); shape4.addBox(-1.5F, 7.5F, -3F, 3, 2, 1); shape4.setRotationPoint(0F, 0F, 0F); shape4.setTextureSize(64, 32); shape4.mirror = true; setRotation(shape4, 0F, 0F, 0F); this.bipedLeftLeg.addChild(shape4); shape5 = new ModelRenderer(this, 16, 2); shape5.addBox(-2.1F, 9.3F, -7.7F, 4, 1, 3); shape5.setRotationPoint(0F, 0F, 0F); shape5.setTextureSize(64, 32); shape5.mirror = true; setRotation(shape5, 0.1919862F, 0F, 0F); this.bipedRightLeg.addChild(shape5); shape6 = new ModelRenderer(this, 1, 2); shape6.addBox(-1.8F, 11F, -5.7F, 4, 1, 3); shape6.setRotationPoint(0F, 0F, 0F); shape6.setTextureSize(64, 32); shape6.mirror = true; setRotation(shape6, 0F, 0F, 0F); this.bipedLeftLeg.addChild(shape6); shape7 = new ModelRenderer(this, 1, 2); shape7.addBox(-6.2F, 11F, -5.7F, 4, 1, 3); shape7.setRotationPoint(0F, 0F, 0F); shape7.setTextureSize(64, 32); shape7.mirror = true; setRotation(shape7, 0F, 0F, 0F); this.bipedRightLeg.addChild(shape7); shape8 = new ModelRenderer(this, 16, 2); shape8.addBox(-1.9F, 9.3F, -7.7F, 4, 1, 3); shape8.setRotationPoint(0F, 0F, 0F); shape8.setTextureSize(64, 32); shape8.mirror = true; setRotation(shape8, 0.1919862F, 0F, 0F); this.bipedLeftLeg.addChild(shape8); } 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); } } Chest: public class ModelRCPChest extends ModelBiped { //fields ModelRenderer shape1; ModelRenderer shape2; ModelRenderer shape3; ModelRenderer shape4; ModelRenderer shape5; ModelRenderer shape6; ModelRenderer shape7; ModelRenderer shape8; ModelRenderer shape9; ModelRenderer shape10; ModelRenderer shpae11; ModelRenderer shpae12; ModelRenderer shpae13; ModelRenderer shape14; ModelRenderer shpaer15; ModelRenderer shpae16; ModelRenderer shpaer17; public ModelRCPChest(float f) { textureWidth = 64; textureHeight = 32; shape1 = new ModelRenderer(this, 38, 1); shape1.addBox(-4.5F, -4F, -3.5F, 6, 5, 7); shape1.setRotationPoint(0F, 0F, 0F); shape1.setTextureSize(64, 32); shape1.mirror = true; setRotation(shape1, 0F, 0F, -0.3490659F); this.bipedRightArm.addChild(shape1); shape2 = new ModelRenderer(this, 38, 1); shape2.addBox(-1.5F, -4F, -3.5F, 6, 5, 7); shape2.setRotationPoint(0F, 0F, 0F); shape2.setTextureSize(64, 32); shape2.mirror = true; setRotation(shape2, 0F, 0F, 0.3490659F); this.bipedLeftArm.addChild(shape2); shape3 = new ModelRenderer(this, 45, 14); shape3.addBox(-1.5F, 0F, -2.5F, 5, 7, 5); shape3.setRotationPoint(0F, 0F, 0F); shape3.setTextureSize(64, 32); shape3.mirror = true; setRotation(shape3, 0F, 0F, 0F); this.bipedLeftArm.addChild(shape3); shape4 = new ModelRenderer(this, 45, 14); shape4.addBox(-3.5F, 0F, -2.5F, 5, 7, 5); shape4.setRotationPoint(0F, 0F, 0F); shape4.setTextureSize(64, 32); shape4.mirror = true; setRotation(shape4, 0F, 0F, 0F); this.bipedRightArm.addChild(shape4); shape5 = new ModelRenderer(this, 1, 15); shape5.addBox(-4.5F, 0F, -2.5F, 9, 11, 5); shape5.setRotationPoint(0F, 0F, 0F); shape5.setTextureSize(64, 32); shape5.mirror = true; setRotation(shape5, 0F, 0F, 0F); this.bipedBody.addChild(shape5); shape6 = new ModelRenderer(this, 1, 7); shape6.addBox(-5F, 8F, -3F, 10, 1, 6); shape6.setRotationPoint(0F, 0F, 0F); shape6.setTextureSize(64, 32); shape6.mirror = true; setRotation(shape6, 0F, 0F, 0F); this.bipedBody.addChild(shape6); shape7 = new ModelRenderer(this, 1, 7); shape7.addBox(-5F, 5F, -3F, 10, 1, 6); shape7.setRotationPoint(0F, 0F, 0F); shape7.setTextureSize(64, 32); shape7.mirror = true; setRotation(shape7, 0F, 0F, 0F); this.bipedBody.addChild(shape7); shape8 = new ModelRenderer(this, 1, 7); shape8.addBox(-5F, 2F, -3F, 10, 1, 6); shape8.setRotationPoint(0F, 0F, 0F); shape8.setTextureSize(64, 32); shape8.mirror = true; setRotation(shape8, 0F, 0F, 0F); this.bipedBody.addChild(shape8); shape9 = new ModelRenderer(this, 1, 7); shape9.addBox(-5F, 11F, -3F, 10, 1, 6); shape9.setRotationPoint(0F, 0F, 0F); shape9.setTextureSize(64, 32); shape9.mirror = true; setRotation(shape9, 0F, 0F, 0F); this.bipedBody.addChild(shape9); shape10 = new ModelRenderer(this, 1, 0); shape10.addBox(2.4F, 3.4F, -6.4F, 1, 3, 3); shape10.setRotationPoint(0F, 0F, 0F); shape10.setTextureSize(64, 32); shape10.mirror = true; setRotation(shape10, 0.7853982F, 0F, 0F); this.bipedLeftArm.addChild(shape10); shpae11 = new ModelRenderer(this, 1, 0); shpae11.addBox(-3.4F, 3.4F, -6.4F, 1, 3, 3); shpae11.setRotationPoint(0F, 0F, 0F); shpae11.setTextureSize(64, 32); shpae11.mirror = true; setRotation(shpae11, 0.7853982F, 0F, 0F); this.bipedRightArm.addChild(shpae11); shpae12 = new ModelRenderer(this, 10, 1); shpae12.addBox(3F, -0.5F, 3F, 2, 2, 1); shpae12.setRotationPoint(0F, 0F, 0F); shpae12.setTextureSize(64, 32); shpae12.mirror = true; setRotation(shpae12, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shpae12); shpae13 = new ModelRenderer(this, 10, 1); shpae13.addBox(5F, 2F, 3F, 2, 2, 1); shpae13.setRotationPoint(0F, 0F, 0F); shpae13.setTextureSize(64, 32); shpae13.mirror = true; setRotation(shpae13, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shpae13); shape14 = new ModelRenderer(this, 10, 1); shape14.addBox(-0.2F, 2.7F, 3F, 2, 2, 1); shape14.setRotationPoint(0F, 0F, 0F); shape14.setTextureSize(64, 32); shape14.mirror = true; setRotation(shape14, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shape14); shpaer15 = new ModelRenderer(this, 10, 1); shpaer15.addBox(2.3F, 4.8F, 3F, 2, 2, 1); shpaer15.setRotationPoint(0F, 0F, 0F); shpaer15.setTextureSize(64, 32); shpaer15.mirror = true; setRotation(shpaer15, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shpaer15); shpae16 = new ModelRenderer(this, 31, 15); shpae16.addBox(-2.8F, 12F, -2.5F, 1, 5, 5); shpae16.setRotationPoint(0F, 0F, 0F); shpae16.setTextureSize(64, 32); shpae16.mirror = true; setRotation(shpae16, 0F, 0F, 0.1745329F); this.bipedBody.addChild(shpae16); shpaer17 = new ModelRenderer(this, 31, 15); shpaer17.addBox(1.8F, 11.9F, -2.5F, 1, 5, 5); shpaer17.setRotationPoint(0F, 0F, 0F); shpaer17.setTextureSize(64, 32); shpaer17.mirror = true; setRotation(shpaer17, 0F, 0F, -0.1745329F); this.bipedBody.addChild(shpaer17); } 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); } } and that should be it Thanks in advance, -Whyneb360 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.