Posted January 11, 201510 yr I am currently working on a part of my code that requires, that the called method knows, if it was called by Server Side (Side.Server) or Client Side (Side.Client). Is there any universal way to check which side is calling the method? (By universal i mean u do not need an additional parameter in the method declaration, you just call a persistent method like "FMLClientHandler.instance().getServer().getEntityWorld()" and get the result) The TileEntitys are Going to kill us all and take over the entire (Minecraft) world!
January 11, 201510 yr FMLcommonHandler.instance().getEffectiveSide() returns Side.SERVER or Side.CLIENT. This might be what you need. I've never had to use it myself, and it has a disclaimer that it might be unreliable, but it might be all you can get. It might be better to refactor your code so it doesn't need to tell which side it is on, or uses a source of information other than the method parameters it gets. Might be more robust. Hard to know without more specific info... -TGG
January 11, 201510 yr Author That was exactly what i needed, thx The TileEntitys are Going to kill us all and take over the entire (Minecraft) world!
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.