Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ChickenWand33

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by ChickenWand33

  1. Hey I was wondering if you could take a look at my post, I see your name everywhere I looked while trying to fix this

  2. Never made a post on here before so hopefully those files are readable, been trying to figure out what is going on here, never made custom armor model before so basically just going off of outdated tutorials and changing things as I go, the model works in game but there are some serious issues package com.chickenwand3.farmbot.objects; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.vertex.IVertexBuilder; import net.minecraft.client.renderer.entity.model.BipedModel; import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.util.ResourceLocation; public abstract class ArmorBaseModel extends BipedModel<LivingEntity>{ protected final ModelRenderer armorHead; protected final ModelRenderer armorBody; protected final ModelRenderer armorRightArm; protected final ModelRenderer armorLeftArm; protected final ModelRenderer armorRightLeg; protected final ModelRenderer armorRightBoot; protected final ModelRenderer armorLeftLeg; protected final ModelRenderer armorLeftBoot; private String texture; public ArmorBaseModel(int textureWidth, int textureHeight, ResourceLocation texture) { super(1F); this.texWidth = textureWidth; this.texHeight = textureHeight; this.texture = texture.toString(); armorHead = new ModelRenderer(this); armorHead.setPos(0.0F, 0.0F, 0.0F); head.addChild(armorHead); armorBody = new ModelRenderer(this); armorBody.setPos(0.0F, 0.0F, 0.0F); body.addChild(armorBody); armorRightArm = new ModelRenderer(this); armorRightArm.setPos(0.0F, 0.0F, 0.0F); rightArm.addChild(armorRightArm); armorLeftArm = new ModelRenderer(this); armorLeftArm.setPos(0.0F, 0.0F, 0.0F); leftArm.addChild(armorLeftArm); armorRightLeg = new ModelRenderer(this); armorRightLeg.setPos(0.0F, 0.0F, 0.0F); rightLeg.addChild(armorRightLeg); armorLeftLeg = new ModelRenderer(this); armorLeftLeg.setPos(0.0F, 0.0F, 0.0F); leftLeg.addChild(armorLeftLeg); armorRightBoot = new ModelRenderer(this); armorRightBoot.setPos(0.0F, 0.0F, 0.0F); rightLeg.addChild(armorRightBoot); armorLeftBoot = new ModelRenderer(this); armorLeftBoot.setPos(0.0F, 0.0F, 0.0F); leftLeg.addChild(armorLeftBoot); setupArmorParts(); } public abstract void setupArmorParts(); public final String getTexture(){ return this.texture; } /** * Feel free to override this method as needed. * It's just required to hide armor parts depending on the equipment slot */ @SuppressWarnings("rawtypes") public BipedModel applySlot(EquipmentSlotType slot){ armorHead.visible = false; armorBody.visible = false; armorRightArm.visible = false; armorLeftArm.visible = false; armorRightLeg.visible = false; armorLeftLeg.visible = false; armorRightBoot.visible = false; armorLeftBoot.visible = false; switch(slot){ case HEAD: armorHead.visible = true; break; case CHEST: armorBody.visible = true; armorRightArm.visible = true; armorLeftArm.visible = true; break; case LEGS: armorRightLeg.visible = true; armorLeftLeg.visible = true; break; case FEET: armorRightBoot.visible = true; armorLeftBoot.visible = true; break; default: break; } return this; } @SuppressWarnings("rawtypes") public final ArmorBaseModel applyEntityStats(BipedModel defaultArmor){ this.crouching = defaultArmor.crouching; this.rightArmPose = defaultArmor.rightArmPose; this.leftArmPose = defaultArmor.leftArmPose; return this; } public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { super.copyPropertiesTo(this); copyModelAngles(this.head, this.armorHead); copyModelAngles(this.body, this.armorBody); copyModelAngles(this.rightArm, this.armorRightArm); copyModelAngles(this.leftArm, this.armorLeftArm); copyModelAngles(this.rightLeg, this.armorRightLeg); copyModelAngles(this.leftLeg, this.armorLeftLeg); copyModelAngles(this.rightLeg, this.armorRightBoot); copyModelAngles(this.leftLeg, this.armorLeftBoot); matrixStack.pushPose(); if(crouching) matrixStack.translate(0, 0.2, 0); this.armorHead.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); this.armorBody.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); this.armorRightArm.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); this.armorLeftArm.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); this.armorRightLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); this.armorLeftLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); this.armorRightBoot.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); this.armorLeftBoot.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); matrixStack.popPose(); } public final void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.xRot = x; modelRenderer.yRot = y; modelRenderer.zRot = z; } private final void copyModelAngles(ModelRenderer in, ModelRenderer out){ out.xRot = in.xRot; out.yRot = in.yRot; out.zRot = in.zRot; } } package com.chickenwand3.farmbot.objects; import net.minecraft.client.renderer.entity.model.BipedModel; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class ArmorRenderer extends ArmorItem{ private ArmorBaseModel armorModel; public ArmorRenderer(IArmorMaterial material, EquipmentSlotType equipmentSlot, Item.Properties properties, ArmorBaseModel armorModel) { super(material, equipmentSlot, properties); this.armorModel = armorModel; } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public final BipedModel getArmorModel(LivingEntity entity, ItemStack itemStack, EquipmentSlotType armorSlot, BipedModel defaultArmor) { return armorModel.applyEntityStats(defaultArmor).applySlot(armorSlot); } public final String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) { return armorModel.getTexture(); } } package com.chickenwand3.farmbot.objects; import net.minecraft.util.ResourceLocation; public class MyCustomArmorModel extends ArmorBaseModel { public MyCustomArmorModel() { super(128, 128, new ResourceLocation("farmbot:textures/models/armor/soularmormodel.png")); } @Override public void setupArmorParts() { armorHead.setPos(0.0F, 0.0F, 0.0F); head.addChild(armorHead); armorHead.texOffs(58, 30).addBox(-5.0F, -8.0F, -5.0F, 2.0F, 8.0F, 1.0F, 0.0F, false); armorHead.texOffs(18, 11).addBox(-5.0F, -8.0F, -4.0F, 1.0F, 8.0F, 8.0F, 0.0F, false); armorHead.texOffs(0, 11).addBox(4.0F, -8.0F, -4.0F, 1.0F, 8.0F, 8.0F, 0.0F, false); armorHead.texOffs(30, 0).addBox(-5.0F, -8.0F, 4.0F, 10.0F, 8.0F, 1.0F, 0.0F, false); armorHead.texOffs(58, 21).addBox(3.0F, -8.0F, -5.0F, 2.0F, 8.0F, 1.0F, 0.0F, false); armorHead.texOffs(28, 16).addBox(-3.0F, -8.0F, -5.0F, 2.0F, 2.0F, 1.0F, 0.0F, false); armorHead.texOffs(0, 0).addBox(-5.0F, -9.0F, -5.0F, 10.0F, 1.0F, 10.0F, 0.0F, false); armorHead.texOffs(20, 15).addBox(1.0F, -8.0F, -5.0F, 2.0F, 2.0F, 1.0F, 0.0F, false); armorHead.texOffs(28, 11).addBox(-1.0F, -8.0F, -5.0F, 2.0F, 4.0F, 1.0F, 0.0F, false); armorBody.setPos(0.0F, 0.0F, 0.0F); body.addChild(armorBody); armorBody.texOffs(18, 27).addBox(-4.0F, 0.0F, 2.0F, 8.0F, 12.0F, 1.0F, 0.0F, false); armorBody.texOffs(0, 27).addBox(-4.0F, 0.0F, -3.0F, 8.0F, 12.0F, 1.0F, 0.0F, false); armorRightArm.setPos(-7.0F, 0.0F, 0.0F); rightArm.addChild(armorRightArm); armorRightArm.texOffs(0, 40).addBox(2.0F, -2.0F, -3.0F, 6.0F, 12.0F, 1.0F, 0.0F, false); armorRightArm.texOffs(36, 37).addBox(2.0F, -2.0F, 2.0F, 6.0F, 12.0F, 1.0F, 0.0F, false); armorRightArm.texOffs(50, 5).addBox(2.0F, -2.0F, -2.0F, 1.0F, 12.0F, 4.0F, 0.0F, false); armorRightArm.texOffs(46, 46).addBox(7.0F, -2.0F, -2.0F, 1.0F, 12.0F, 4.0F, 0.0F, false); armorLeftArm.setPos(12.0F, 0.0F, 0.0F); leftArm.addChild(armorLeftArm); armorLeftArm.texOffs(36, 24).addBox(-13.0F, -2.0F, -3.0F, 6.0F, 12.0F, 1.0F, 0.0F, false); armorLeftArm.texOffs(36, 11).addBox(-13.0F, -2.0F, 2.0F, 6.0F, 12.0F, 1.0F, 0.0F, false); armorLeftArm.texOffs(24, 40).addBox(-13.0F, -2.0F, -2.0F, 1.0F, 12.0F, 4.0F, 0.0F, false); armorLeftArm.texOffs(14, 40).addBox(-8.0F, -2.0F, -2.0F, 1.0F, 12.0F, 4.0F, 0.0F, false); armorRightLeg.setPos(0.0F, 0.0F, 0.0F); rightLeg.addChild(armorRightLeg); armorRightLeg.texOffs(50, 29).addBox(6.0F, 0.0F, -2.0F, 0.0F, 12.0F, 4.0F, 0.0F, false); armorRightLeg.texOffs(50, 17).addBox(2.0F, 0.0F, -2.0F, 0.0F, 12.0F, 4.0F, 0.0F, false); armorRightLeg.texOffs(56, 45).addBox(2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 0.0F, 0.0F, false); armorRightLeg.texOffs(24, 56).addBox(2.0F, 0.0F, 2.0F, 4.0F, 12.0F, 0.0F, 0.0F, false); armorRightBoot.setPos(0.0F, 0.0F, 0.0F); rightLeg.addChild(armorRightBoot); armorRightBoot.texOffs(52, 0).addBox(2.0F, 9.0F, -3.0F, 4.0F, 3.0F, 1.0F, 0.0F, false); armorRightBoot.texOffs(14, 11).addBox(2.0F, 12.0F, -2.0F, 4.0F, 0.0F, 4.0F, 0.0F, false); armorRightBoot.texOffs(0, 14).addBox(2.0F, 9.0F, 2.0F, 4.0F, 3.0F, 0.0F, 0.0F, false); armorRightBoot.texOffs(56, 52).addBox(6.0F, 9.0F, -3.0F, 0.0F, 3.0F, 5.0F, 0.0F, false); armorRightBoot.texOffs(56, 0).addBox(2.0F, 9.0F, -3.0F, 0.0F, 3.0F, 5.0F, 0.0F, false); armorLeftLeg.setPos(-4.0F, 0.0F, 0.0F); leftLeg.addChild(armorLeftLeg); armorLeftLeg.texOffs(16, 56).addBox(-2.0F, 0.0F, 2.0F, 4.0F, 12.0F, 0.0F, 0.0F, false); armorLeftLeg.texOffs(8, 56).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 0.0F, 0.0F, false); armorLeftLeg.texOffs(0, 49).addBox(-2.0F, 0.0F, -2.0F, 0.0F, 12.0F, 4.0F, 0.0F, false); armorLeftLeg.texOffs(34, 46).addBox(2.0F, 0.0F, -2.0F, 0.0F, 12.0F, 4.0F, 0.0F, false); armorLeftBoot.setPos(-4.0F, 0.0F, 0.0F); leftLeg.addChild(armorLeftBoot); armorLeftBoot.texOffs(10, 10).addBox(-2.0F, 9.0F, -3.0F, 0.0F, 3.0F, 5.0F, 0.0F, false); armorLeftBoot.texOffs(0, 0).addBox(2.0F, 9.0F, -3.0F, 0.0F, 3.0F, 5.0F, 0.0F, false); armorLeftBoot.texOffs(0, 11).addBox(-2.0F, 9.0F, 2.0F, 4.0F, 3.0F, 0.0F, 0.0F, false); armorLeftBoot.texOffs(0, 0).addBox(-2.0F, 9.0F, -3.0F, 4.0F, 3.0F, 1.0F, 0.0F, false); armorLeftBoot.texOffs(6, 11).addBox(-2.0F, 12.0F, -2.0F, 4.0F, 0.0F, 4.0F, 0.0F, false); } } It renders the armor that I want but also adds some of my texture mashed of the face of the player??
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.