Posted July 7, 201411 yr Hello everyone, I tought i make this simple info because i saw a lot of people using @SideOnly to make their code only run on one side. Thats a bad idea! @SideOnly is for making a code only VISIBLE for one side. Feel the difference? Its good for registration purposes, but you have your Common and ClientProxy, right? You might ask now, than what can we use??? If in your code you have a World as argument or instance you can use: if(world.isRemote) -world.isRemote = CLIENT -!world.isRemote = SERVER Its that simple! Or if you cannot get world for some reason use SIDE checking: Side side = FMLCommonHandler.instance().getEffectiveSide(); if(side == Side.CLIENT) { System.out.println("CLIENT"); }else{ System.out.println("SERVER"); } Hope you now not gonna mess up your code and be suprised why is it not working!
July 7, 201411 yr Author Im just trying to write that for modders who don't understand it. It not what i don't understand its for others You probably getting sick by seeing how everyone use @SideOnly even if they dont know what it is for. Well they can know it now.
July 7, 201411 yr i must admit i have been wondering why use proxys when you can tell what side code to be with "side only" but then i have never fully understood the proxy classes, most guides will tell you how to create them but not how to effectively use them, they along with packet handlers remain a bit of a mystery to me. I have always taken the approach that if my code works then im happy, im sure if many seasoned modders looked at my source code they would hunt me down with pitchforks , but then im only modding for the fun of getting something working in game not for the masses(will be released as always for those that may want it but im not planning to be the next calclavia/xcompwizard/dan200 etc etc)
July 7, 201411 yr Hi This link has a bit more info on Proxy that might help further. http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
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.