Posted March 18, 20169 yr How do I flip an entity upside down through RenderLivingEvent? Right now it doesn't do anything when the entities have my potion effect. Here is my code : @SubscribeEvent public void renderLiving(RenderLivingEvent.Post event){ if(event.entity.getActivePotionEffect(MagiCraft.flipped) != null){ GL11.glPushMatrix(); GL11.glRotated(180, 0, 0, 1); GL11.glPopMatrix(); } } Yes I have registered it and it is getting called. Thanks! Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 18, 20169 yr Author Well when I remove that, all entities are flipped. What exactly does push/pop matrix do? 2) I changed it to Pre Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 18, 20169 yr Author So how do I properly use them to do what I want? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 18, 20169 yr Before it renders: push the state, change the state After it renders: restore the state Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
March 18, 20169 yr Author Do I use both the RenderLivingEvent.Pre and Post events? Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 18, 20169 yr Do I use both the RenderLivingEvent.Pre and Post events? Uh, let me check. Before it renders: push the state, change the state After it renders: restore the state Pretty sure that "Before" and "After" are two different phases. But you know what, do it in only one and see how that works out for you. Oh wait, you did. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
March 19, 20169 yr Author Ok I did that, however the only entity that renders while my potion effect is active is the player. Any of the other entities are not affected. I checked with LivingUpdateEvent that the potion effect was registering, and LivingUpdate said that they had my potion effect active. For some reason it just isn't registering on the client. How do I fix this? Code: @SubscribeEvent public void renderLiving(RenderLivingEvent.Pre event){ if(event.entity.getActivePotionEffect(MagiCraft.flipped) != null){ GL11.glPushMatrix(); GL11.glRotatef(180.0f, 0, 0, 1.0f); GL11.glTranslated(0, event.entity.height/2 + 0.1f, 0); } } @SubscribeEvent public void renderLiving(RenderLivingEvent.Post event){ if(event.entity.getActivePotionEffect(MagiCraft.flipped) != null){ GL11.glPopMatrix(); } } Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 19, 20169 yr Author Could I just have an isFlipped property in the IExtendedEntityProperties that is set to true when the entity has the potion and false when is doesn't? Then the client would get the isFlipped property and determine whether or not to flip it. Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
March 19, 20169 yr Author Oh ok Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.
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.