Posted October 16, 201312 yr I've been modding for a few months now and I've always build my mod by putting it into the src/minecraft folder and then running recompile.sh and then reobfuscate_srg.sh. And it worked flawlessly on both client and server side. But the last time I tried it I keep getting errors when I try to run it on a server (client still works perfectly) The errors vary but they are all NoSuchMethod/NoSuchField (not sure if exact name, but shouldn't matter) exceptions, thrown by fields such as this: @SideOnly(Side.CLIENT) private Icon[] icon = new Icon[2]; And if I comment that one out, then some other client only field throws the same/similar exception (EntityPlayerSP from when one of my events loads up, even though I don't import/use it anywhere in the methods). I tried using the last 3 versions of forge (930 and beyond) getting the same results. Am I doing something wrong? Can someone point me out on the right direction. Thank you
October 16, 201312 yr you're accessing client on fields on the dedicated server. They flat out do not exist on the dedicated server. Hence why they are CLIENTonly Quit referencing code that doesn't exist. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
October 16, 201312 yr Author but for example.. the icon variable I showed. I only use it twice... creating the variable, and then registering it (in that usual method), both with the SideOnly(Side.Client) annotation. If that's wrong, than how am I meant to register block icons for example?
October 16, 201312 yr private Icon[] icon = new Icon[2]; The 'icon = new Icon[2];' Is actually code that is compiled into your constructor. So if you have side only fields, you can't use inline initalizers. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
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.