Hextor Posted April 3, 2015 Posted April 3, 2015 I have a mob,that renders as a bided,his model extends the biped class and still somehow doesn't holds the item i tell him to do. Here are my classes: public class ModelDefaultOrcGuard extends ModelBiped { //fields public ModelRenderer bipedHead; public ModelRenderer bipedHeadwear; public ModelRenderer bipedBody; public ModelRenderer bipedRightArm; public ModelRenderer bipedLeftArm; public ModelRenderer bipedRightLeg; public ModelRenderer bipedLeftLeg; public ModelDefaultOrcGuard() { textureWidth = 64; textureHeight = 32; bipedHead = new ModelRenderer(this, 0, 0); bipedHead.addBox(-4F, -8F, -4F, 8, 8, ; bipedHead.setRotationPoint(0F, 0F, 0F); bipedHead.setTextureSize(64, 32); bipedHead.mirror = true; setRotation(bipedHead, 0F, 0F, 0F); bipedBody = new ModelRenderer(this, 16, 16); bipedBody.addBox(-4F, 0F, -2F, 8, 12, 4); bipedBody.setRotationPoint(0F, 0F, 0F); bipedBody.setTextureSize(64, 32); bipedBody.mirror = true; setRotation(bipedBody, 0F, 0F, 0F); bipedRightArm = new ModelRenderer(this, 40, 16); bipedRightArm.addBox(-3F, -2F, -2F, 4, 12, 4); bipedRightArm.setRotationPoint(-5F, 2F, 0F); bipedRightArm.setTextureSize(64, 32); bipedRightArm.mirror = true; setRotation(bipedRightArm, 0F, 0F, 0F); bipedLeftArm = new ModelRenderer(this, 40, 16); bipedLeftArm.addBox(-1F, -2F, -2F, 4, 12, 4); bipedLeftArm.setRotationPoint(5F, 2F, 0F); bipedLeftArm.setTextureSize(64, 32); bipedLeftArm.mirror = true; setRotation(bipedLeftArm, 0F, 0F, 0F); bipedRightLeg = new ModelRenderer(this, 0, 16); bipedRightLeg.addBox(-2F, 0F, -2F, 4, 12, 4); bipedRightLeg.setRotationPoint(-2F, 12F, 0F); bipedRightLeg.setTextureSize(64, 32); bipedRightLeg.mirror = true; setRotation(bipedRightLeg, 0F, 0F, 0F); bipedLeftLeg = new ModelRenderer(this, 0, 16); bipedLeftLeg.addBox(-2F, 0F, -2F, 4, 12, 4); bipedLeftLeg.setRotationPoint(2F, 12F, 0F); bipedLeftLeg.setTextureSize(64, 32); bipedLeftLeg.mirror = true; setRotation(bipedLeftLeg, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { setRotationAngles(entity,f, f1, f2, f3, f4, f5); bipedHead.render(f5); bipedBody.render(f5); bipedRightArm.render(f5); bipedLeftArm.render(f5); bipedRightLeg.render(f5); bipedLeftLeg.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(Entity entity,float f, float f1, float f2, float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5,entity); this.bipedHead.rotateAngleY = f3 / (180F / (float)Math.PI); this.bipedHead.rotateAngleX = f4 / (180F / (float)Math.PI); this.bipedRightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 2.0F * f1 * 0.5F; this.bipedLeftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F; this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedRightLeg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; this.bipedLeftLeg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1; this.bipedRightLeg.rotateAngleY = 0.0F; this.bipedLeftLeg.rotateAngleY = 0.0F; } } public class RenderDefaultOrcGuard extends RenderBiped{ private static final ResourceLocation DOGTextures = new ResourceLocation(Aethoscraft.modid + ":" + "textures/model/DefOrcGuard.png"); protected ModelDefaultOrcGuard modelEntity; public RenderDefaultOrcGuard(ModelBiped model, float f) { super(model, f); modelEntity = ((ModelDefaultOrcGuard)mainModel); } protected void renderEquippedItems(EntityDefaultOrcGuard entity, float par2) { super.renderEquippedItems((EntityLiving)entity, par2); } protected void renderEquippedItems(EntityLivingBase entityLivingBase, float par2) { this.renderEquippedItems((EntityDefaultOrcGuard)entityLivingBase, par2); } @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.DOGTextures; } Quote
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.