Posted November 23, 20177 yr I'm currently attempting to add a custom armor to a mod that i am creating and i seem to be having problems making the model arms, legs and head to follow the player this is my client proxy class package com.turcanu.tfam.Proxy; import com.turcanu.tfam.Init.ModArmors; import com.turcanu.tfam.Init.ModBlocks; import com.turcanu.tfam.Init.ModItems; public class ClientProxy extends CommonProxy { @Override public void init() { ModItems.registerRenders(); ModBlocks.registerRenders(); ModArmors.registerRenders(); ModArmors.registerModelRenders(); } } model class (WARNING:lots of code in this class) Spoiler package com.turcanu.tfam.Armor.ArmorModels; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelDragonMarchersArmorSet extends ModelBiped { private ModelRenderer RightArmShoulderPad; private ModelRenderer RightArmSkinTop; private ModelRenderer RightArmSkinRight; private ModelRenderer RightArmSkinBack; private ModelRenderer RightArmSkinFront; private ModelRenderer RightArmSkinBottom; private ModelRenderer RightArmSkinLeft; private ModelRenderer LeftArmSkinLeft; private ModelRenderer LeftArmShoulderPad; private ModelRenderer LeftArmSkinRight; private ModelRenderer LeftArmSkinBack; private ModelRenderer LeftArmSkinFront; private ModelRenderer LeftArmSkinBottom; private ModelRenderer LeftArmSkinTop; private ModelRenderer ChestSkinFront; private ModelRenderer ChestSkinBack; private ModelRenderer ChestSkinLeft; private ModelRenderer ChestSkinRight; private ModelRenderer ChestSkinFrontLeft; private ModelRenderer ChestSkinFrontRight; private ModelRenderer ChestButton1; private ModelRenderer ChestButton2; private ModelRenderer ChestButton3; private ModelRenderer ChestButton4; private ModelRenderer ChestButton5; private ModelRenderer ChestBadge; private ModelRenderer TopHatCap; private ModelRenderer TopHatBase; private ModelRenderer TopHatBadge; private ModelRenderer RightLegSkinFront; private ModelRenderer RightLegSkinBack; private ModelRenderer RightLegSkinLeft; private ModelRenderer RightLegSkinRight; private ModelRenderer RightLegSkinShoe; private ModelRenderer LeftLegSkinFront; private ModelRenderer LeftLegSkinShoe; private ModelRenderer LeftLegSkinBack; private ModelRenderer LeftLegSkinLeft; private ModelRenderer LeftLegSkinRight; public ModelDragonMarchersArmorSet(Float expand) { super(expand, 1, 128, 66); this.textureWidth = 128; this.textureHeight = 66; this.TopHatBadge = new ModelRenderer(this, 56, 0); this.TopHatBadge.setRotationPoint(-0.5F, -10.0F, -3.0F); this.TopHatBadge.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); this.LeftArmSkinRight = new ModelRenderer(this, 0, 20); this.LeftArmSkinRight.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftArmSkinRight.addBox(-2.0F, -3.0F, -2.0F, 1, 13, 4, 0.0F); this.RightLegSkinLeft = new ModelRenderer(this, 10, 43); this.RightLegSkinLeft.setRotationPoint(0.0F, 0.0F, 0.0F); this.RightLegSkinLeft.addBox(2.0F, 0.0F, -2.0F, 1, 9, 4, 0.0F); this.ChestButton3 = new ModelRenderer(this, 16, 0); this.ChestButton3.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestButton3.addBox(-3.0F, 5.0F, -3.8F, 1, 1, 1, 0.0F); this.LeftLegSkinRight = new ModelRenderer(this, 76, 52); this.LeftLegSkinRight.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftLegSkinRight.addBox(-3.0F, 0.0F, -2.0F, 1, 9, 4, 0.0F); this.LeftArmShoulderPad = new ModelRenderer(this, 94, 16); this.LeftArmShoulderPad.setRotationPoint(-2.0F, -4.0F, -1.5F); this.LeftArmShoulderPad.addBox(0.0F, 0.0F, 0.0F, 4, 1, 3, 0.0F); this.ChestBadge = new ModelRenderer(this, 52, 0); this.ChestBadge.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestBadge.addBox(0.0F, 0.1F, -3.8F, 1, 1, 1, 0.0F); this.setRotateAngle(ChestBadge, 0.0F, 0.0F, 0.7853981633974483F); this.LeftArmSkinBottom = new ModelRenderer(this, 98, 25); this.LeftArmSkinBottom.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftArmSkinBottom.addBox(-2.0F, 10.0F, -3.0F, 6, 1, 6, 0.0F); this.RightArmSkinBack = new ModelRenderer(this, 37, 16); this.RightArmSkinBack.setRotationPoint(-2.0F, 0.0F, 0.0F); this.RightArmSkinBack.addBox(-2.0F, -3.0F, 2.0F, 6, 13, 1, 0.0F); this.RightArmSkinTop = new ModelRenderer(this, 10, 16); this.RightArmSkinTop.setRotationPoint(-1.0F, -3.0F, -2.0F); this.RightArmSkinTop.addBox(-2.0F, 0.0F, 0.0F, 4, 1, 4, 0.0F); this.LeftArmSkinTop = new ModelRenderer(this, 98, 20); this.LeftArmSkinTop.setRotationPoint(-1.0F, -3.0F, -2.0F); this.LeftArmSkinTop.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4, 0.0F); this.ChestButton5 = new ModelRenderer(this, 32, 0); this.ChestButton5.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestButton5.addBox(-3.0F, 9.0F, -3.8F, 1, 1, 1, 0.0F); this.RightLegSkinBack = new ModelRenderer(this, 82, 45); this.RightLegSkinBack.setRotationPoint(0.0F, 0.0F, 0.0F); this.RightLegSkinBack.addBox(-3.0F, 0.0F, 2.0F, 6, 9, 1, 0.0F); this.ChestSkinRight = new ModelRenderer(this, 78, 27); this.ChestSkinRight.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestSkinRight.addBox(-5.0F, 0.0F, -3.0F, 1, 12, 6, 0.0F); this.TopHatBase = new ModelRenderer(this, 24, 43); this.TopHatBase.setRotationPoint(0.0F, 0.0F, 0.0F); this.TopHatBase.addBox(-4.0F, -9.0F, -4.0F, 8, 1, 8, 0.0F); this.RightArmShoulderPad = new ModelRenderer(this, 0, 16); this.RightArmShoulderPad.setRotationPoint(-2.0F, -4.0F, -1.5F); this.RightArmShoulderPad.addBox(0.0F, 0.0F, 0.0F, 4, 1, 3, 0.0F); this.LeftLegSkinBack = new ModelRenderer(this, 62, 52); this.LeftLegSkinBack.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftLegSkinBack.addBox(-3.0F, 0.0F, 2.0F, 6, 9, 1, 0.0F); this.ChestSkinFront = new ModelRenderer(this, 36, 30); this.ChestSkinFront.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestSkinFront.addBox(-4.0F, 0.0F, -3.0F, 8, 12, 1, 0.0F); this.RightArmSkinFront = new ModelRenderer(this, 50, 16); this.RightArmSkinFront.setRotationPoint(-4.0F, -3.0F, -3.0F); this.RightArmSkinFront.addBox(0.0F, 0.0F, 0.0F, 6, 13, 1, 0.0F); this.LeftArmSkinFront = new ModelRenderer(this, 64, 23); this.LeftArmSkinFront.setRotationPoint(-2.0F, -3.0F, -3.0F); this.LeftArmSkinFront.addBox(0.0F, 0.0F, 0.0F, 6, 13, 1, 0.0F); this.TopHatCap = new ModelRenderer(this, 58, 39); this.TopHatCap.setRotationPoint(0.0F, 0.0F, 0.0F); this.TopHatCap.addBox(-3.0F, -14.6F, -3.5F, 6, 7, 6, 0.0F); this.setRotateAngle(TopHatCap, -0.10471975511965977F, 0.0F, 0.0F); this.ChestButton1 = new ModelRenderer(this, 0, 0); this.ChestButton1.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestButton1.addBox(-3.0F, 1.0F, -3.8F, 1, 1, 1, 0.0F); this.ChestButton4 = new ModelRenderer(this, 28, 0); this.ChestButton4.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestButton4.addBox(-3.0F, 7.0F, -3.8F, 1, 1, 1, 0.0F); this.LeftLegSkinShoe = new ModelRenderer(this, 34, 52); this.LeftLegSkinShoe.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftLegSkinShoe.addBox(-3.5F, 9.0F, -3.5F, 7, 3, 7, 0.0F); this.RightLegSkinRight = new ModelRenderer(this, 96, 45); this.RightLegSkinRight.setRotationPoint(0.0F, 0.0F, 0.0F); this.RightLegSkinRight.addBox(-3.0F, 0.0F, -2.0F, 1, 9, 4, 0.0F); this.LeftArmSkinBack = new ModelRenderer(this, 10, 21); this.LeftArmSkinBack.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftArmSkinBack.addBox(-2.0F, -3.0F, 2.0F, 6, 13, 1, 0.0F); this.LeftArmSkinLeft = new ModelRenderer(this, 88, 16); this.LeftArmSkinLeft.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftArmSkinLeft.addBox(3.0F, -3.0F, -2.0F, 1, 13, 4, 0.0F); this.RightLegSkinFront = new ModelRenderer(this, 0, 37); this.RightLegSkinFront.setRotationPoint(0.0F, 0.0F, 0.0F); this.RightLegSkinFront.addBox(-3.0F, 0.0F, -3.0F, 6, 9, 1, 0.0F); this.ChestSkinBack = new ModelRenderer(this, 97, 32); this.ChestSkinBack.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestSkinBack.addBox(-4.0F, 0.0F, 2.0F, 8, 12, 1, 0.0F); this.ChestSkinFrontLeft = new ModelRenderer(this, 115, 32); this.ChestSkinFrontLeft.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestSkinFrontLeft.addBox(1.0F, 0.0F, -3.4F, 4, 12, 1, 0.0F); this.LeftLegSkinFront = new ModelRenderer(this, 20, 52); this.LeftLegSkinFront.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftLegSkinFront.addBox(-3.0F, 0.0F, -3.0F, 6, 9, 1, 0.0F); this.ChestSkinLeft = new ModelRenderer(this, 18, 29); this.ChestSkinLeft.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestSkinLeft.addBox(4.0F, 0.0F, -3.0F, 1, 12, 6, 0.0F); this.RightArmSkinRight = new ModelRenderer(this, 26, 16); this.RightArmSkinRight.setRotationPoint(-2.0F, 0.0F, 0.0F); this.RightArmSkinRight.addBox(-2.0F, -3.0F, -2.0F, 1, 13, 4, 0.0F); this.RightLegSkinShoe = new ModelRenderer(this, 99, 51); this.RightLegSkinShoe.setRotationPoint(0.0F, 0.0F, 0.0F); this.RightLegSkinShoe.addBox(-3.5F, 9.0F, -3.5F, 7, 3, 7, 0.0F); this.ChestButton2 = new ModelRenderer(this, 12, 0); this.ChestButton2.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestButton2.addBox(-3.0F, 3.0F, -3.8F, 1, 1, 1, 0.0F); this.RightArmSkinBottom = new ModelRenderer(this, 64, 16); this.RightArmSkinBottom.setRotationPoint(0.0F, 0.0F, 0.0F); this.RightArmSkinBottom.addBox(-4.0F, 10.0F, -3.0F, 6, 1, 6, 0.0F); this.LeftLegSkinLeft = new ModelRenderer(this, 0, 47); this.LeftLegSkinLeft.setRotationPoint(0.0F, 0.0F, 0.0F); this.LeftLegSkinLeft.addBox(2.0F, 0.0F, -2.0F, 1, 9, 4, 0.0F); this.RightArmSkinLeft = new ModelRenderer(this, 116, 12); this.RightArmSkinLeft.setRotationPoint(1.0F, -3.0F, -2.0F); this.RightArmSkinLeft.addBox(0.0F, 0.0F, 0.0F, 1, 13, 4, 0.0F); this.ChestSkinFrontRight = new ModelRenderer(this, 54, 30); this.ChestSkinFrontRight.setRotationPoint(0.0F, 0.0F, 0.0F); this.ChestSkinFrontRight.addBox(-5.0F, 0.0F, -3.4F, 4, 12, 1, 0.0F); this.bipedHead.addChild(this.TopHatBadge); this.bipedLeftArm.addChild(this.LeftArmSkinRight); this.bipedRightLeg.addChild(this.RightLegSkinLeft); this.bipedBody.addChild(this.ChestButton3); this.bipedLeftLeg.addChild(this.LeftLegSkinRight); this.bipedLeftArm.addChild(this.LeftArmShoulderPad); this.bipedBody.addChild(this.ChestBadge); this.bipedLeftArm.addChild(this.LeftArmSkinBottom); this.bipedRightArm.addChild(this.RightArmSkinBack); this.bipedRightArm.addChild(this.RightArmSkinTop); this.bipedLeftArm.addChild(this.LeftArmSkinTop); this.bipedBody.addChild(this.ChestButton5); this.bipedRightLeg.addChild(this.RightLegSkinBack); this.bipedBody.addChild(this.ChestSkinRight); this.bipedHead.addChild(this.TopHatBase); this.bipedRightArm.addChild(this.RightArmShoulderPad); this.bipedLeftLeg.addChild(this.LeftLegSkinBack); this.bipedBody.addChild(this.ChestSkinFront); this.bipedRightArm.addChild(this.RightArmSkinFront); this.bipedLeftArm.addChild(this.LeftArmSkinFront); this.bipedHead.addChild(this.TopHatCap); this.bipedBody.addChild(this.ChestButton1); this.bipedBody.addChild(this.ChestButton4); this.bipedLeftLeg.addChild(this.LeftLegSkinShoe); this.bipedRightLeg.addChild(this.RightLegSkinRight); this.bipedLeftArm.addChild(this.LeftArmSkinBack); this.bipedLeftArm.addChild(this.LeftArmSkinLeft); this.bipedRightLeg.addChild(this.RightLegSkinFront); this.bipedBody.addChild(this.ChestSkinBack); this.bipedBody.addChild(this.ChestSkinFrontLeft); this.bipedLeftLeg.addChild(this.LeftLegSkinFront); this.bipedBody.addChild(this.ChestSkinLeft); this.bipedRightArm.addChild(this.RightArmSkinRight); this.bipedRightLeg.addChild(this.RightLegSkinShoe); this.bipedBody.addChild(this.ChestButton2); this.bipedRightArm.addChild(this.RightArmSkinBottom); this.bipedLeftLeg.addChild(this.LeftLegSkinLeft); this.bipedRightArm.addChild(this.RightArmSkinLeft); this.bipedBody.addChild(this.ChestSkinFrontRight); } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { this.bipedLeftLeg.render(f5); this.bipedHead.render(f5); this.bipedRightLeg.render(f5); this.bipedRightArm.render(f5); this.bipedLeftArm.render(f5); this.bipedBody.render(f5); } /** * This is a helper function from Tabula to set the rotation of model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } armor class package com.turcanu.tfam.Armor; import com.turcanu.tfam.Init.ModArmors; import com.turcanu.tfam.Main; import com.turcanu.tfam.Utils.Refrances; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import javax.annotation.Nullable; public class DragonMarcherSet extends ItemArmor { public DragonMarcherSet(ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn, String UnlocalizedName, String RegistryNames) { super(materialIn, renderIndexIn, equipmentSlotIn); this.setUnlocalizedName(UnlocalizedName); this.setRegistryName(RegistryNames); this.setCreativeTab(Main.TABS); } @Override public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return Refrances.MODID + ":textures/models/armor/DragonMarchersArmorSet.png"; } @Override @SideOnly(Side.CLIENT) @Nullable public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped _default) { if (itemStack != null) { if (itemStack.getItem() instanceof ItemArmor) { ModelBiped armorModel = ModArmors.armorModel.get(this); armorModel.bipedRightLeg.showModel = armorSlot == EntityEquipmentSlot.FEET; armorModel.bipedLeftLeg.showModel = armorSlot == EntityEquipmentSlot.FEET; armorModel.isSneak = _default.isSneak; armorModel.isRiding = _default.isRiding; armorModel.isChild = _default.isChild; armorModel.rightArmPose = _default.rightArmPose; armorModel.leftArmPose = _default.leftArmPose; return armorModel; } } return null; } } this is the class i register the armor and stuff package com.turcanu.tfam.Init; import com.turcanu.tfam.Armor.ArmorModels.ModelDragonMarchersArmorSet; import com.turcanu.tfam.Armor.DragonMarcherSet; import com.turcanu.tfam.Armor.TestSet; import com.turcanu.tfam.Utils.Refrances; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.init.SoundEvents; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.registry.GameRegistry; import java.util.HashMap; import java.util.Map; public class ModArmors { //Materials public static ItemArmor.ArmorMaterial testMaterial = EnumHelper.addArmorMaterial("testMaterial",Refrances.MODID + ":testMaterial", 30, new int[] {2,6,5,2}, 9, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 2.0F); public static ItemArmor.ArmorMaterial dragonMetal = EnumHelper.addArmorMaterial("dragonMetalIngot", Refrances.MODID + ":dragonMetalIngot", 0, new int[] {2,6, 5, 2}, 9, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 10.0F); //Test Set public static ItemArmor TestHead; public static ItemArmor TestChest; public static ItemArmor TestLegs; public static ItemArmor TestFeet; //Dragon Marcher Set public static ItemArmor dragonMarchersSetHead; public static ItemArmor dragonMarchersSetChest; public static ItemArmor dragonMarchersSetLegs; public static ItemArmor dragonMarchersSetFeet; public static void init(){ TestHead = new TestSet(testMaterial, 1, EntityEquipmentSlot.HEAD, "ArmorTestHead", "Test_Armor_Head"); TestChest = new TestSet(testMaterial, 1, EntityEquipmentSlot.CHEST, "ArmorTestChest", "Test_Armor_Chest"); TestLegs = new TestSet(testMaterial, 2, EntityEquipmentSlot.LEGS, "ArmorTestLegs", "Test_Armor_Legs"); TestFeet = new TestSet(testMaterial, 1, EntityEquipmentSlot.FEET, "ArmorTestFeet", "Test_Armor_Feet"); dragonMarchersSetHead = new DragonMarcherSet(dragonMetal, 1 , EntityEquipmentSlot.HEAD,"DragonMarcherSetHead","Dragon_Marcher_Set_Head"); dragonMarchersSetChest = new DragonMarcherSet(dragonMetal, 1 , EntityEquipmentSlot.CHEST,"DragonMarcherSetChest","Dragon_Marcher_Set_Chest"); dragonMarchersSetLegs = new DragonMarcherSet(dragonMetal, 1 , EntityEquipmentSlot.LEGS,"DragonMarcherSetLegs","Dragon_Marcher_Set_Legs"); dragonMarchersSetFeet = new DragonMarcherSet(dragonMetal, 1 , EntityEquipmentSlot.FEET,"DragonMarcherSetFeet","Dragon_Marcher_Set_Feet"); } public static void register(){ registerArmor(TestHead); registerArmor(TestChest); registerArmor(TestLegs); registerArmor(TestFeet); registerArmor(dragonMarchersSetHead); registerArmor(dragonMarchersSetChest); registerArmor(dragonMarchersSetLegs); registerArmor(dragonMarchersSetFeet); } public static void registerArmor(Item armor){ GameRegistry.register(armor); } public static void registerRenders(){ registerRenders(TestHead); registerRenders(TestChest); registerRenders(TestLegs); registerRenders(TestFeet); registerRenders(dragonMarchersSetHead); registerRenders(dragonMarchersSetChest); registerRenders(dragonMarchersSetLegs); registerRenders(dragonMarchersSetFeet); } private static void registerRenders(Item item){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(),"inventory")); } private static final ModelDragonMarchersArmorSet dragonMarchersArmorSetChest = new ModelDragonMarchersArmorSet(1F); private static final ModelDragonMarchersArmorSet dragonMarchersArmorSetLegs = new ModelDragonMarchersArmorSet(0.5F); public static final Map<Item, ModelBiped> armorModel = new HashMap<Item, ModelBiped>(); public static void registerModelRenders(){ armorModel.put(dragonMarchersSetHead, dragonMarchersArmorSetChest); armorModel.put(dragonMarchersSetChest, dragonMarchersArmorSetChest); armorModel.put(dragonMarchersSetLegs, dragonMarchersArmorSetLegs); armorModel.put(dragonMarchersSetFeet, dragonMarchersArmorSetChest); } } This is my problem. Edited December 4, 20177 yr by ShadowKing345 i fixed the issue but there is no soultion from this post
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.