Posted October 31, 201510 yr I've already searched for a solution to my problem and i'm unable to solve it on my own, probably because i don't have much knowlodege about openGL or rendering. This is my render class: public class HunterHatRender extends ModelBiped { private final IModelCustom hunterHat; public HunterHatRender() { hunterHat = AdvancedModelLoader.loadModel(new ResourceLocation(Main.MODID, "models/hunterHat.obj")); ModelRenderer objModelAttach = new ModelRenderer(this){ @Override public void render(float f) { GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 1.0F, 0.0F); FMLClientHandler.instance().getClient().renderEngine .bindTexture(new ResourceLocation(Main.MODID, "textures/armor/texture.png")); hunterHat.renderAll(); GL11.glPopMatrix(); } }; bipedHead.addChild(objModelAttach); } } An this is what i get: I know the model (hat) isn't finished, is incorrectly placed and doesn't have a texture, but those are other problems i know how to fix. Why does a biped without textures render on top of the normal player? I just wan't to render my hat Thank you.
November 2, 201510 yr The problem you are having is that it is rendering the entire new biped model when your armor is equipped to fix it you need to tell the model to not render those pieces. Here is my implementation https://github.com/Sudwood/AdvancedUtilities/blob/master/java/com/sudwood/advancedutilities/items/ItemArmorRebreather.java#L109
November 7, 201510 yr Author I'm almost there. With this code: @SideOnly(Side.CLIENT) @Override public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { ModelBiped armorModel = null; if (itemStack != null && itemStack.getItem() instanceof HunterHat) { armorModel = new HunterHatRender(); armorModel.bipedHead.showModel = true; armorModel.bipedHeadwear.showModel = false; armorModel.bipedBody.showModel = false; armorModel.bipedRightArm.showModel = false; armorModel.bipedLeftArm.showModel = false; armorModel.bipedRightLeg.showModel = false; armorModel.bipedLeftLeg.showModel = false; armorModel.isSneak = entityLiving.isSneaking(); armorModel.isRiding = entityLiving.isRiding(); armorModel.isChild = entityLiving.isChild(); if (entityLiving instanceof EntityPlayer) { armorModel.aimedBow = ((EntityPlayer) entityLiving) .getItemInUseDuration() > 2; armorModel.heldItemRight = ((EntityPlayer) entityLiving) .getCurrentEquippedItem() != null ? 1 : 0; } } return armorModel; } I get this: bipedHead.showModel = true is the only way i can see my model, but i still get the biped head rendered. Also, the model looks f***d up, almost nothing like what i modeled, but thats another problem.
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.