Posted April 27, 201411 yr In my mod, I'm trying to cancel the default player rendering and rendering my own model. The problem I'm having, is that in the pre event, I cancel it. Because of that, it cancels the post event too, which my rendering code is in. package net.rpg.handler; import net.minecraftforge.client.event.RenderPlayerEvent; import net.rpg.Util; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class PlayerRenderHandler { @SubscribeEvent public void renderPrePlayer(RenderPlayerEvent.Pre event) { if(!Util.isNewPlayer(event.entityPlayer)) { event.setCanceled(true); } } @SubscribeEvent public void renderPostPlayer(RenderPlayerEvent.Post event) { if(!Util.isNewPlayer(event.entityPlayer)) { //Render player } } } Kain
April 27, 201411 yr Author I'll do that for now I guess, someone in the past told me to always do extra rendering in the post event and canceling in the pre event. Kain
April 27, 201411 yr I'll do that for now I guess, someone in the past told me to always do extra rendering in the post event and canceling in the pre event. What they probably meant is that if you intend to cancel the event, you can only do so in Pre, but if you just want to add some extra rendering on top of the normal player rendering, to do it in Post after the rest of the player renders, though there is nothing stopping you from doing that rendering in Pre as well, and, indeed, if you are canceling the Pre then the Post won't get called, meaning in such a case you must render in Pre. http://i.imgur.com/NdrFdld.png[/img]
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.