Posted February 15, 201510 yr Hello, This is more of a hypothetical question (I don't have any code to show), but what's the best way to change the player's arm rotation? I imagine it would involve a RenderPlayerEvent, where you cancel the arm rendering and render new ones, but how would one get the player's skin to display on these arms? Thanks! Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
February 15, 201510 yr Hi RenderPlayer.renderFirstPersonArm() does all that, called from renderItemInFirstPerson, so I imagine you would just need to copy the setup code out of there that you need. for example this.mc.getTextureManager().bindTexture(entityclientplayermp.getLocationSkin()); and this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_82441_1_); -TGG
February 15, 201510 yr Author Ok, I got the right arm rendering, but held items are no longer translated/rotated. Here's my code: private ModelDismemberedArm model = new ModelDismemberedArm(); @SubscribeEvent public void render(RenderPlayerEvent.Specials.Post evt) { evt.renderer.modelBipedMain.bipedRightArm.showModel = true; evt.renderer.modelBipedMain.bipedLeftArm.showModel = true; GL11.glPushMatrix(); evt.renderer.modelBipedMain.bipedRightArm.postRender(0.0625f); if(evt.entityPlayer instanceof EntityClientPlayerMP)Minecraft.getMinecraft().renderEngine.bindTexture(((EntityClientPlayerMP)evt.entityPlayer).getLocationSkin()); model.render(); GL11.glPopMatrix(); evt.renderer.modelBipedMain.bipedRightArm.showModel = false; evt.renderer.modelBipedMain.bipedLeftArm.showModel = false; } public class ModelDismemberedArm extends ModelBase { public ModelRenderer arm; public ModelDismemberedArm() { this.textureWidth = 64; this.textureHeight = 32; this.arm = new ModelRenderer(this, 40, 16); this.arm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0); } public void render() { this.arm.render(0.0625f); } } Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
February 15, 201510 yr What in the world? Why are you creating a new model? You said you wanted to change the rotation not make a new one!
February 15, 201510 yr Author I've read that it's the only way to accomplish this. Do you know of another? Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
February 17, 201510 yr Author Anyone? Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
February 18, 201510 yr Why didn't you do what TGG said? this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_82441_1_); Should work.. (Of course on RenderPlayerEvent.Specials.Pre) I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
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.