Posted June 6, 201411 yr Heyho Guys! I created two new types of fire, namely flash fire and hell fire. I wanted to create them via potion effects. Everything works fine, except the rendering: I have created an EventHandler for the Event RenderLivingEvent.Post . There, I test if the Potions are active and if so, I render the entity on fire. But unfortunately, this only works for the active player. Neither mobs nor other players with the effect applied are rendered on fire. I think this is because the potions are controlled from the server, so the client doesn't need the active effects... But anyway, how can I solve this? Code: @SubscribeEvent public void onRenderLiving(RenderLivingEvent.Post e) { if (e.entity == Minecraft.getMinecraft().thePlayer) GL11.glTranslatef(0.0F, 1.2F, 0.0F); if (e.entity.isPotionActive(ModPotions.flash_fire.id)) this.renderEntityOnFire(e.entity, e.x, e.y, e.z, true); if (e.entity.isPotionActive(ModPotions.hell_fire.id)) this.renderEntityOnFire(e.entity, e.x, e.y, e.z, false); } If I leave out the if statements, It works fine. http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
June 6, 201411 yr I think your title is misleading. Minecraft.getMinecraft().thePlayer is a client-side method, which gets the player on the client side (this means for YOU only!) When you call renderEntityOnFire, you are calling it on the "client side" once again. You won't see it for other players (because it's client side) and you won't see it for mobs (because you never set it to render for mobs!)
June 6, 201411 yr Author I think, you understood me wrong. Well, it might be my fault because I didn't say this clearly: The first if-statement is to remove a small bug where the fire is rendered below the player. The last two if-statements control the actual fire rendering and they are called for EVERY entity. As I said, the problem is the if statement which checks for the active effect, because if I leave it out everything is exactly as I want it to be. http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
June 6, 201411 yr Author OK, I now created some data storgae and packets and everything works except one thing: If I register the EventHandler for the packet's sending method in my ServerProxy and start a Dedicated Server, everything works fine. But if I start my Combined Client and try a Singleplayer world, the event Handlers are not registered. If I place them in the commonProxy (called on client & server) everything is fine, they are registered on BOTH sides. But I only want them to be registered on SERVER side. Why does this not work??? Server Proxy: public class ServerProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); MinecraftForge.EVENT_BUS.register(new EventHandlerPotionUpdater()); FMLCommonHandler.instance().bus().register(new EventHandlerPotionUpdater()); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } } CommonProxy: (I removed unimportant stuff) public class CommonProxy { public void preInit(FMLPreInitializationEvent e) { } public void init(FMLInitializationEvent e) { //MinecraftForge.EVENT_BUS.register(new EventHandlerPotionUpdater()); //FMLCommonHandler.instance().bus().register(new EventHandlerPotionUpdater()); } public void postInit(FMLPostInitializationEvent e) { } } Client Proxy: public class ClientProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); MinecraftForge.EVENT_BUS.register(new EventHandlerPotionRenderer()); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } } Registration: @SidedProxy(clientSide="com.bedrockminer.magicum.ClientProxy", serverSide="com.bedrockminer.magicum.ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent e) { proxy.preInit(e); } @EventHandler public void init(FMLInitializationEvent e) { proxy.init(e); } @EventHandler public void postInit(FMLPostInitializationEvent e) { proxy.postInit(e); } http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
June 6, 201411 yr Author Thanks a lot, that was something I didn't know about. It works fine now But.. When do you use the server proxy? I can actually see no situation where you would need it http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
June 7, 201411 yr You use the client proxy things only needed on the client, like rendering and textures etc, and the server proxy for things that should be registered both sides, like TileEntitys etc. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
June 7, 201411 yr Author The "helper class" is actually my CommonProxy. May I ask when you needed th ServerProxy? http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
June 7, 201411 yr Author Ah, Ok. Thanks http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
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.