Jump to content

Obeeron

Members
  • Posts

    27
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Obeeron's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hello ! As for the original problem take a look at this : https://github.com/MinecraftForge/MinecraftForge/issues/2508#issuecomment-287781387 You'll get a better grasp of what's going on. Basically, your "setRotationsAngles" functions has to act differently whether the entity is a player or an armor_stand. Here, your "setRotationsAngles" will always act as if the armor_stand was a player, therefore you have to test in "setRotationAngles" if the entity is an armor_stand, if it is then you have to copy the hardcoded values from ModelArmorStand::setRotationAngles and apply them to your armor, if it isn't an ArmorStandEntity, just call the normal behaviour off "setRotationAngles" with super When you think you've understood what's going on, take a look at how Botania fixes this : https://github.com/Vazkii/Botania/blob/1.14-final/src/main/java/vazkii/botania/client/model/armor/ModelArmor.java When you have this kind of problems always try to look how other mods do it
  2. Hello, I would like to add custom weapon models made with Blockbench to my mod. What would be the way to go ?
  3. This is an 'inflate' parameter, apparently it does not affect the texture. I finally made it work thanks to your tutorial ^^ : https://championash5357.github.io/ChampionAsh5357/tutorial/minecraft/1.16.1/items/armor
  4. Yup it's the same, it's because the one from my previous message was a screenshot for making it bigger on the screen. Okay so correct me if I'm wrong, the top half 64*32 part of the texture is a default area used by the bipedModel. If I want to make an armorModel texture I should get into consideration some kind of template to avoid interfering with it (what template should I use ? an armor one ?). The parts of my armor that align with this basic template could have their texture on it. However the different armor parts that differ from a vanilla armor model should have their texture outside the 64*32 (or within the few empty space). Also, why does the boots render correctly and below the player ._.
  5. This isn't the texture, it's a screenshot of the texture oppened in Photoshop. The original texture is 64*64 as I mentionned in the model constructor super(size, 0, 64, 64); Here is the real texture : So should I move the custom model texture outside the 64*32 ?
  6. Hello, How may I slow down only growth speed ? RandomTickSpeed also affects leave decay time, fire spreading or even campfire smoke but I onlly want to slow down seeds growth speed and maybe saplings too
  7. So here is what I get now (on an armorstand) As you can see the textures seem heavily shifted. Here is the corresponding code : public class BronzeArmorModel extends BipedModel<LivingEntity> { public BronzeArmorModel(float size) { super(size, 0, 64, 64); ModelRenderer helmet; ModelRenderer chestplate; ModelRenderer ChestBtmPiece_R; ModelRenderer ChestBtmPiece_L; ModelRenderer rightBoot; ModelRenderer rightBootTop; ModelRenderer leftBoot; ModelRenderer leftBootTop; helmet = new ModelRenderer(this); helmet.setRotationPoint(0.0F, 0.0F, 0.0F); helmet.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.51F, false); helmet.setTextureOffset(0, 16).addBox(-4.0F, -8.5F, -4.0F, 8.0F, 1.0F, 8.0F, 0.45F, false); chestplate = new ModelRenderer(this); chestplate.setRotationPoint(0.0F, 5.3625F, 0.0F); chestplate.setTextureOffset(32, 0).addBox(-4.0F, -5.3625F, -2.0F, 8.0F, 11.0F, 4.0F, 0.28F, true); chestplate.setTextureOffset(40, 20).addBox(-2.0F, 6.0875F, -2.0F, 4.0F, 1.0F, 4.0F, 0.29F, false); ChestBtmPiece_R = new ModelRenderer(this); ChestBtmPiece_R.setRotationPoint(-1.5F, 4.6375F, 0.0F); chestplate.addChild(ChestBtmPiece_R); setRotationAngle(ChestBtmPiece_R, 0.0F, 0.0F, 0.2618F); ChestBtmPiece_R.setTextureOffset(12, 41).addBox(-2.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false); ChestBtmPiece_L = new ModelRenderer(this); ChestBtmPiece_L.setRotationPoint(1.5F, 4.6375F, 0.0F); chestplate.addChild(ChestBtmPiece_L); setRotationAngle(ChestBtmPiece_L, 0.0F, 0.0F, -0.2618F); ChestBtmPiece_L.setTextureOffset(0, 41).addBox(0.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false); rightBoot = new ModelRenderer(this); rightBoot.setRotationPoint(-2.0F, 21.0F, 0.0F); rightBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, false); rightBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, false); rightBootTop = new ModelRenderer(this); rightBootTop.setRotationPoint(0.0F, -1.5F, -1.5F); rightBoot.addChild(rightBootTop); setRotationAngle(rightBootTop, 0.1745F, 0.0F, 0.0F); rightBootTop.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, false); leftBoot = new ModelRenderer(this); leftBoot.setRotationPoint(2.0F, 21.0F, 0.0F); leftBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, true); leftBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, true); leftBootTop = new ModelRenderer(this); leftBootTop.setRotationPoint(0.0F, -1.5F, -1.5F); leftBoot.addChild(leftBootTop); setRotationAngle(leftBootTop, 0.1745F, 0.0F, 0.0F); leftBootTop.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, true); bipedHead.addChild(helmet); bipedBody.addChild(chestplate); bipedLeftLeg.addChild(leftBoot); bipedRightLeg.addChild(rightBoot); } @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){ super.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } public class BronzeArmor extends ArmorItem { public BronzeArmor(IArmorMaterial materialIn, EquipmentSlotType slot) { super(materialIn, slot, new Item.Properties().group(ModSetup.######_GROUP)); } @SuppressWarnings("unchecked") @Nullable @Override public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default) { BronzeArmorModel model = new BronzeArmorModel(1.0F); model.bipedHead.showModel = armorSlot == EquipmentSlotType.HEAD; model.bipedHeadwear.showModel = false; model.bipedBody.showModel = armorSlot == EquipmentSlotType.CHEST; model.bipedLeftArm.showModel = false; model.bipedRightArm.showModel = false; model.bipedRightLeg.showModel = armorSlot == EquipmentSlotType.FEET; model.bipedLeftLeg.showModel = armorSlot == EquipmentSlotType.FEET; model.isChild = _default.isChild; model.isSitting = _default.isSitting; model.isSneak = _default.isSneak; model.rightArmPose = _default.rightArmPose; model.leftArmPose = _default.leftArmPose; return (A) model; } @Nullable @Override public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) { return "######:textures/models/armor/bronze_armor.png"; } }
  8. Then what's the method to not use showModel
  9. To be honest moving them manually is way too hard, some of the pieces are tilted and it seems that they move according to their local rotation so.. I forfeit on that. I'm willing to redo the entire thing because I prefer having something clean rather than twiking some values to cheat on the render. Could you explain how to implement your local ModelRenderers method regarding 'setRotationAngles', 'render' and the constructor ? If I get it right, I should only have the ModelRenderer variables declared within the constructor (otherwise they would magicaly be detected and rendered twice if I understood correctly) but then I have to change the .showModel boolean also in the constructor ? Thank you!
  10. Wait how do I fix the box locations manually
  11. Okay so basically, if I get the render function like this : @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){ helmet.render(matrixStack, buffer, packedLight, packedOverlay); chestplate.render(matrixStack, buffer, packedLight, packedOverlay); rightBoot.render(matrixStack, buffer, packedLight, packedOverlay); leftBoot.render(matrixStack, buffer, packedLight, packedOverlay); } then it does render properly but the animations do not work. And if I get the render function like this : @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { super.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); } then the animations work but the the texture are totally mixed (see screenshot below) In all the 'tutorials' I've seen, people enable / disable the models within getArmorModel function in the armor class like this: model.helmet.showModel = armorSlot == EquipmentSlotType.HEAD; model.chestplate.showModel = armorSlot == EquipmentSlotType.CHEST; model.rightSleeve.showModel = armorSlot == EquipmentSlotType.CHEST; model.leftSleeve.showModel = armorSlot == EquipmentSlotType.CHEST; model.rightLegging.showModel = armorSlot == EquipmentSlotType.LEGS; model.leftLegging.showModel = armorSlot == EquipmentSlotType.LEGS; model.rightBoot.showModel = armorSlot == EquipmentSlotType.FEET; model.leftBoot.showModel = armorSlot == EquipmentSlotType.FEET; Should I not do it like that ?
  12. Okay so if I understand correctly, this.bipedHead is the global ModelRenderer and helmet is the child, but you said I was suppose to make the local ModelRenderer local variables within the constructor. However I need to access them for the rendering part. What did I get wrong ?
  13. Okay so I managed to make it match the head and legs rotation + sneak but as you can see the models are too high. The boots are at the start of the legs and the chestplate starts at the middle of the body Here is the code : public class BronzeArmorModel extends BipedModel<LivingEntity> { public final ModelRenderer helmet; public final ModelRenderer chestplate; private final ModelRenderer bone2; private final ModelRenderer bone3; public final ModelRenderer leftBoot; private final ModelRenderer bone5; public final ModelRenderer rightBoot; private final ModelRenderer bone8; public BronzeArmorModel(float size) { super(size, 0, 64, 64); textureWidth = 64; textureHeight = 64; helmet = new ModelRenderer(this); helmet.setRotationPoint(0.0F, 0.0F, 0.0F); helmet.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.51F, false); helmet.setTextureOffset(0, 16).addBox(-4.0F, -8.5F, -4.0F, 8.0F, 1.0F, 8.0F, 0.45F, false); chestplate = new ModelRenderer(this); chestplate.setRotationPoint(0.0F, 5.3625F, 0.0F); chestplate.setTextureOffset(32, 0).addBox(-4.0F, -5.3625F, -2.0F, 8.0F, 11.0F, 4.0F, 0.28F, true); chestplate.setTextureOffset(40, 20).addBox(-2.0F, 6.0875F, -2.0F, 4.0F, 1.0F, 4.0F, 0.29F, false); bone2 = new ModelRenderer(this); bone2.setRotationPoint(-1.5F, 4.6375F, 0.0F); chestplate.addChild(bone2); setRotationAngle(bone2, 0.0F, 0.0F, 0.2618F); bone2.setTextureOffset(12, 41).addBox(-2.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false); bone3 = new ModelRenderer(this); bone3.setRotationPoint(1.5F, 4.6375F, 0.0F); chestplate.addChild(bone3); setRotationAngle(bone3, 0.0F, 0.0F, -0.2618F); bone3.setTextureOffset(0, 41).addBox(0.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false); leftBoot = new ModelRenderer(this); leftBoot.setRotationPoint(-2.0F, 21.0F, 0.0F); leftBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, false); leftBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, false); bone5 = new ModelRenderer(this); bone5.setRotationPoint(0.0F, -1.5F, -1.5F); leftBoot.addChild(bone5); setRotationAngle(bone5, 0.1745F, 0.0F, 0.0F); bone5.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, false); rightBoot = new ModelRenderer(this); rightBoot.setRotationPoint(2.0F, 21.0F, 0.0F); rightBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, true); rightBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, true); bone8 = new ModelRenderer(this); bone8.setRotationPoint(0.0F, -1.5F, -1.5F); rightBoot.addChild(bone8); setRotationAngle(bone8, 0.1745F, 0.0F, 0.0F); bone8.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, true); this.bipedHead.addChild(helmet); this.bipedBody.addChild(chestplate); this.bipedLeftLeg.addChild(leftBoot); this.bipedRightLeg.addChild(rightBoot); } @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { // super.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); helmet.render(matrixStack, buffer, packedLight, packedOverlay); chestplate.render(matrixStack, buffer, packedLight, packedOverlay); leftBoot.render(matrixStack, buffer, packedLight, packedOverlay); rightBoot.render(matrixStack, buffer, packedLight, packedOverlay); } @Override public void setRotationAngles(LivingEntity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { super.setRotationAngles(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); this.helmet.copyModelAngles(this.bipedHead); this.chestplate.copyModelAngles(this.bipedBody); this.leftBoot.copyModelAngles(this.bipedLeftLeg); this.rightBoot.copyModelAngles(this.bipedRightLeg); } public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } }
  14. Mhm.. I replaced the functions in the model class as in your code but it now seems to render twice (at least for the head) and not in a.. let's say 'coherent' way Here is what it used to look like:
  15. I got the armor to render but it does not rotate with the arms/legs/head movement. It also does not change when sneaking or when sitting. However it does rotate all at once with when I turn. Here are the 2 classes : public class BronzeArmorModel extends BipedModel<LivingEntity> { public final ModelRenderer helmet; public final ModelRenderer chestplate; private final ModelRenderer bone2; private final ModelRenderer bone3; public final ModelRenderer leftBoot; private final ModelRenderer bone5; public final ModelRenderer rightBoot; private final ModelRenderer bone8; public BronzeArmorModel(float size) { super(size); textureWidth = 64; textureHeight = 64; helmet = new ModelRenderer(this); helmet.setRotationPoint(0.0F, 0.0F, 0.0F); helmet.setTextureOffset(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.51F, false); helmet.setTextureOffset(0, 16).addBox(-4.0F, -8.5F, -4.0F, 8.0F, 1.0F, 8.0F, 0.45F, false); chestplate = new ModelRenderer(this); chestplate.setRotationPoint(0.0F, 5.3625F, 0.0F); chestplate.setTextureOffset(32, 0).addBox(-4.0F, -5.3625F, -2.0F, 8.0F, 11.0F, 4.0F, 0.28F, true); chestplate.setTextureOffset(40, 20).addBox(-2.0F, 6.0875F, -2.0F, 4.0F, 1.0F, 4.0F, 0.29F, false); bone2 = new ModelRenderer(this); bone2.setRotationPoint(-1.5F, 4.6375F, 0.0F); chestplate.addChild(bone2); setRotationAngle(bone2, 0.0F, 0.0F, 0.2618F); bone2.setTextureOffset(12, 41).addBox(-2.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false); bone3 = new ModelRenderer(this); bone3.setRotationPoint(1.5F, 4.6375F, 0.0F); chestplate.addChild(bone3); setRotationAngle(bone3, 0.0F, 0.0F, -0.2618F); bone3.setTextureOffset(0, 41).addBox(0.3F, 1.55F, -2.0F, 2.0F, 1.0F, 4.0F, 0.29F, false); leftBoot = new ModelRenderer(this); leftBoot.setRotationPoint(-2.0F, 21.0F, 0.0F); leftBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, false); leftBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, false); bone5 = new ModelRenderer(this); bone5.setRotationPoint(0.0F, -1.5F, -1.5F); leftBoot.addChild(bone5); setRotationAngle(bone5, 0.1745F, 0.0F, 0.0F); bone5.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, false); rightBoot = new ModelRenderer(this); rightBoot.setRotationPoint(2.0F, 21.0F, 0.0F); rightBoot.setTextureOffset(28, 15).addBox(-2.0F, -2.25F, -2.0F, 4.0F, 5.0F, 4.0F, 0.26F, true); rightBoot.setTextureOffset(24, 41).addBox(-2.0F, -2.0F, -2.5F, 4.0F, 4.0F, 1.0F, 0.0F, true); bone8 = new ModelRenderer(this); bone8.setRotationPoint(0.0F, -1.5F, -1.5F); rightBoot.addChild(bone8); setRotationAngle(bone8, 0.1745F, 0.0F, 0.0F); bone8.setTextureOffset(0, 0).addBox(-1.5F, -1.5F, -1.0F, 3.0F, 2.0F, 1.0F, 0.0F, true); this.bipedHead.addChild(helmet); this.bipedBody.addChild(chestplate); this.bipedLeftLeg.addChild(leftBoot); this.bipedRightLeg.addChild(rightBoot); } @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){ helmet.render(matrixStack, buffer, packedLight, packedOverlay); chestplate.render(matrixStack, buffer, packedLight, packedOverlay); leftBoot.render(matrixStack, buffer, packedLight, packedOverlay); rightBoot.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; } } public class BronzeArmor extends ArmorItem { public BronzeArmor(IArmorMaterial materialIn, EquipmentSlotType slot) { super(materialIn, slot, new Item.Properties().group(ModSetup.MELTEM_GROUP)); // TODO Auto-generated constructor stub } @SuppressWarnings("unchecked") @Nullable @Override public <A extends BipedModel<?>> A getArmorModel(LivingEntity entityLiving, ItemStack itemStack, EquipmentSlotType armorSlot, A _default) { if(itemStack != ItemStack.EMPTY && itemStack.getItem() instanceof ArmorItem) { BronzeArmorModel model = new BronzeArmorModel(1.0F); model.helmet.showModel = armorSlot == EquipmentSlotType.HEAD; model.chestplate.showModel = armorSlot == EquipmentSlotType.CHEST; model.rightBoot.showModel = armorSlot == EquipmentSlotType.FEET; model.leftBoot.showModel = armorSlot == EquipmentSlotType.FEET; model.isChild = _default.isChild; model.isSitting = _default.isSitting; model.isSneak = _default.isSneak; model.rightArmPose = _default.rightArmPose; model.leftArmPose = _default.leftArmPose; return (A) model; } return null; } @Nullable @Override public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) { return "######:textures/models/armor/bronze_armor.png"; } }
×
×
  • Create New...

Important Information

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