Jump to content

TonyGamer

Members
  • Posts

    3
  • Joined

  • Last visited

TonyGamer's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Oh... I saw that earlier but I only skimmed through it and completely overlooked that section... I will try that and see what happens, thanks. EDIT: Also it wasn't set as a biped model because I had exported it from block bench and forgot to change it to a biped model.
  2. I added custom armor with a custom model to a mod that I am working on, and I have gotten the model to render correctly on the player, but when I attempt to put the armor on an armorstand, it animates as if it is on a player. I have an idea of why this might be happening, but I have no clue how to fix it. Here is the model file and the class of one of the armor pieces: CopperArmorModel.java public class CopperArmorModel extends EntityModel<Entity> { public final ModelRenderer RightLeg; public final ModelRenderer LeftLeg; public final ModelRenderer RightBoot; public final ModelRenderer LeftBoot; public final ModelRenderer Body; public final ModelRenderer Head; private final ModelRenderer Eye; private final ModelRenderer PipesR; private final ModelRenderer PipesL; private final ModelRenderer Gears; private final ModelRenderer Gear1; private final ModelRenderer GearsRot; private final ModelRenderer Gear2; private final ModelRenderer GearsRot2; public final ModelRenderer LeftArm; private final ModelRenderer Angle; public final ModelRenderer RightArm; private final ModelRenderer Angle2; public CopperArmorModel() { textureWidth = 128; textureHeight = 128; RightLeg = new ModelRenderer(this); RightLeg.setRotationPoint(2.0F, 12.0F, 0.0F); RightLeg.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.475F, false); LeftLeg = new ModelRenderer(this); LeftLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); LeftLeg.setTextureOffset(16, 48).addBox(2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.475F, false); RightBoot = new ModelRenderer(this); RightBoot.setTextureOffset(0, 32).addBox(-5.0F, 8.75F, -4.0F, 6.0F, 4.0F, 7.0F, -0.45F, false); LeftBoot = new ModelRenderer(this); LeftBoot.setTextureOffset(0, 32).addBox(-1.0F, 8.75F, -4.0F, 6.0F, 4.0F, 7.0F, -0.45F, false); Body = new ModelRenderer(this); Body.setRotationPoint(-2.0F, 12.0F, 0.0F); Body.setTextureOffset(16, 16).addBox(-2.0F, -0.5F, -2.0F, 8.0F, 12.0F, 4.0F, 0.5F, false); Body.setTextureOffset(52, 9).addBox(-0.5F, 3.5F, -3.0F, 5.0F, 5.0F, 1.0F, -0.75F, false); Head = new ModelRenderer(this); Head.setRotationPoint(0.0F, 0.0F, 0.0F); Head.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.525F, false); Head.setTextureOffset(0, 0).addBox(1.75F, -5.625F, -4.75F, 1.0F, 1.0F, 1.0F, -0.2F, false); Head.setTextureOffset(32, 6).addBox(-3.5F, -4.25F, -6.0F, 7.0F, 7.0F, 3.0F, -2.0F, false); Head.setTextureOffset(26, 32).addBox(-3.475F, -4.25F, -7.175F, 7.0F, 7.0F, 6.0F, -1.9F, false); Eye = new ModelRenderer(this); Eye.setRotationPoint(0.0F, -5.0F, 0.0F); Head.addChild(Eye); Eye.setTextureOffset(24, 0).addBox(-4.75F, -2.25F, -5.5F, 5.0F, 2.0F, 2.0F, -0.9F, false); Eye.setTextureOffset(24, 0).addBox(-4.375F, -2.625F, -5.55F, 2.0F, 5.0F, 2.0F, -0.9F, false); Eye.setTextureOffset(24, 0).addBox(-4.75F, 0.0F, -5.5F, 5.0F, 2.0F, 2.0F, -0.9F, false); Eye.setTextureOffset(24, 0).addBox(-2.125F, -2.625F, -5.55F, 2.0F, 5.0F, 2.0F, -0.9F, false); Eye.setTextureOffset(24, 0).addBox(-0.25F, -2.25F, -5.5F, 5.0F, 2.0F, 2.0F, -0.9F, false); Eye.setTextureOffset(24, 0).addBox(0.125F, -2.625F, -5.55F, 2.0F, 5.0F, 2.0F, -0.9F, false); Eye.setTextureOffset(24, 0).addBox(-0.25F, 0.0F, -5.5F, 5.0F, 2.0F, 2.0F, -0.9F, false); Eye.setTextureOffset(24, 0).addBox(2.375F, -2.625F, -5.55F, 2.0F, 5.0F, 2.0F, -0.9F, false); PipesR = new ModelRenderer(this); PipesR.setRotationPoint(-2.75F, -2.25F, 0.5F); Head.addChild(PipesR); setRotationAngle(PipesR, 0.1745F, -0.0873F, 0.1309F); PipesR.setTextureOffset(24, 2).addBox(-3.0F, -1.0F, -6.0F, 3.0F, 1.0F, 1.0F, -0.25F, false); PipesR.setTextureOffset(24, 0).addBox(-3.5F, -1.0F, -6.0F, 1.0F, 1.0F, 6.0F, -0.25F, false); PipesR.setTextureOffset(24, 0).addBox(-3.5F, -1.0F, -1.0F, 2.0F, 1.0F, 1.0F, -0.25F, false); PipesR.setTextureOffset(24, 2).addBox(-1.0F, -1.0F, -6.0F, 1.0F, 1.0F, 2.0F, -0.25F, false); PipesL = new ModelRenderer(this); PipesL.setRotationPoint(2.75F, -2.25F, 0.5F); Head.addChild(PipesL); setRotationAngle(PipesL, 0.1745F, 0.0873F, -0.1309F); PipesL.setTextureOffset(24, 2).addBox(0.0F, -1.0F, -6.0F, 1.0F, 1.0F, 2.0F, -0.25F, false); PipesL.setTextureOffset(24, 2).addBox(0.0F, -1.0F, -6.0F, 3.0F, 1.0F, 1.0F, -0.25F, false); PipesL.setTextureOffset(24, 0).addBox(2.5F, -1.0F, -6.0F, 1.0F, 1.0F, 6.0F, -0.25F, false); PipesL.setTextureOffset(24, 0).addBox(1.5F, -1.0F, -1.0F, 2.0F, 1.0F, 1.0F, -0.25F, false); Gears = new ModelRenderer(this); Gears.setRotationPoint(0.0F, 0.0F, 0.0F); Head.addChild(Gears); Gear1 = new ModelRenderer(this); Gear1.setRotationPoint(1.25F, -5.25F, 0.0F); Gears.addChild(Gear1); Gear1.setTextureOffset(24, 1).addBox(-2.5F, -0.5F, 4.0F, 5.0F, 1.0F, 1.0F, -0.25F, false); Gear1.setTextureOffset(24, 1).addBox(0.5F, -1.5F, 4.0F, 1.0F, 3.0F, 1.0F, -0.25F, false); Gear1.setTextureOffset(24, 1).addBox(-1.5F, -1.5F, 4.0F, 1.0F, 3.0F, 1.0F, -0.25F, false); Gear1.setTextureOffset(24, 1).addBox(-0.5F, -2.5F, 4.0F, 1.0F, 5.0F, 1.0F, -0.25F, false); Gear1.setTextureOffset(24, 1).addBox(-1.5F, -1.5F, 4.0F, 3.0F, 1.0F, 1.0F, -0.25F, false); Gear1.setTextureOffset(24, 1).addBox(-1.5F, 0.5F, 4.0F, 3.0F, 1.0F, 1.0F, -0.25F, false); GearsRot = new ModelRenderer(this); GearsRot.setRotationPoint(0.0F, 0.0F, 0.0F); Gear1.addChild(GearsRot); setRotationAngle(GearsRot, 0.0F, 0.0F, 0.7854F); GearsRot.setTextureOffset(24, 1).addBox(-0.5F, -2.5F, 4.0F, 1.0F, 5.0F, 1.0F, -0.25F, false); GearsRot.setTextureOffset(24, 1).addBox(-2.5F, -0.5F, 4.0F, 5.0F, 1.0F, 1.0F, -0.25F, false); Gear2 = new ModelRenderer(this); Gear2.setRotationPoint(-1.5F, -2.5F, 0.0F); Gears.addChild(Gear2); setRotationAngle(Gear2, 0.0F, 0.0F, 0.3927F); Gear2.setTextureOffset(24, 1).addBox(-2.5F, -0.5F, 4.0F, 5.0F, 1.0F, 1.0F, -0.25F, false); Gear2.setTextureOffset(24, 1).addBox(0.5F, -1.5F, 4.0F, 1.0F, 3.0F, 1.0F, -0.25F, false); Gear2.setTextureOffset(24, 1).addBox(-1.5F, -1.5F, 4.0F, 1.0F, 3.0F, 1.0F, -0.25F, false); Gear2.setTextureOffset(24, 1).addBox(-0.5F, -2.5F, 4.0F, 1.0F, 5.0F, 1.0F, -0.25F, false); Gear2.setTextureOffset(24, 1).addBox(-1.5F, -1.5F, 4.0F, 3.0F, 1.0F, 1.0F, -0.25F, false); Gear2.setTextureOffset(24, 1).addBox(-1.5F, 0.5F, 4.0F, 3.0F, 1.0F, 1.0F, -0.25F, false); GearsRot2 = new ModelRenderer(this); GearsRot2.setRotationPoint(0.0F, 0.0F, 0.0F); Gear2.addChild(GearsRot2); setRotationAngle(GearsRot2, 0.0F, 0.0F, 0.7854F); GearsRot2.setTextureOffset(24, 1).addBox(-0.5F, -2.5F, 4.0F, 1.0F, 5.0F, 1.0F, -0.25F, false); GearsRot2.setTextureOffset(24, 1).addBox(-2.5F, -0.5F, 4.0F, 5.0F, 1.0F, 1.0F, -0.25F, false); LeftArm = new ModelRenderer(this); LeftArm.setRotationPoint(-9.75F, 0.0F, 0.0F); LeftArm.setTextureOffset(32, 48).addBox(9.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.45F, false); Angle = new ModelRenderer(this); Angle.setRotationPoint(11.0F, -2.0F, 0.0F); LeftArm.addChild(Angle); setRotationAngle(Angle, 0.0F, 0.0F, -0.1745F); Angle.setTextureOffset(59, 10).addBox(0.25F, -0.425F, -2.5F, 2.0F, 1.0F, 5.0F, -0.05F, false); RightArm = new ModelRenderer(this); RightArm.setRotationPoint(9.75F, 0.0F, 0.0F); RightArm.setTextureOffset(40, 16).addBox(-13.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, 0.45F, false); Angle2 = new ModelRenderer(this); Angle2.setRotationPoint(-9.0F, -2.0F, 0.0F); RightArm.addChild(Angle2); setRotationAngle(Angle2, 0.0F, 0.0F, 0.1745F); Angle2.setTextureOffset(59, 10).addBox(-4.25F, -0.075F, -2.5F, 2.0F, 1.0F, 5.0F, -0.05F, false); } @Override public void setRotationAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){ //previously the render function, render code was moved to a method below } @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){ RightLeg.render(matrixStack, buffer, packedLight, packedOverlay); LeftLeg.render(matrixStack, buffer, packedLight, packedOverlay); Body.render(matrixStack, buffer, packedLight, packedOverlay); Head.render(matrixStack, buffer, packedLight, packedOverlay); LeftArm.render(matrixStack, buffer, packedLight, packedOverlay); RightArm.render(matrixStack, buffer, packedLight, packedOverlay); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } CopperChestplate.java: public class CopperChestplate extends ArmorItem { private BipedModel<LivingEntity> model = null; public CopperChestplate() { super(Copper.COPPER, EquipmentSlotType.CHEST, new Properties().group(Steampunk.TAB)); } @Override public <A extends BipedModel<?>> A getArmorModel(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlotType armorSlot, A _default) { if(this.model == null) { this.model = new BipedModel<>(1); CopperArmorModel tempModel = new CopperArmorModel(); model.bipedBody = tempModel.Body; model.bipedLeftArm.addChild(tempModel.LeftArm); model.bipedRightArm.addChild(tempModel.RightArm); model.isSneak = livingEntity.isSneaking(); model.isSitting = livingEntity.isPassenger(); model.isChild = livingEntity.isChild(); } return (A) this.model; } @Override public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) { return Steampunk.MOD_ID+":textures/models/armor/copper_armor.png"; } } Some notes about these files: the model file was mostly generated from blockbench, with some modifications made to allow it to work as an armor model. The armor item getArmorModel function was found from another post somewhere else (I don't remember where and the post was hard to find in the first place), as well as some modifications to get it to render correctly in the current versions, and also my attempt at caching the model (I don't know if it is a good idea to cache it or if I even implemented it correctly).
  3. I would like to join the server if I can, I know I'm late but I'd like to join
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.