[8.0.0] Client-side code being accessed by server causes crashes
halvors opened this issue ยท 19 comments
This is still crashing: http://pastebin.com/3EzDbvYh
Simular to "closed" issue #2226
Quoted from "http://www.minecraftforge.net/forum/index.php?topic=23724.0"
It's not enough to avoid calling ISound. If you have a class which has any ISound in it at all, even if you never directly call those methods, and you create that class on the server side, then you will get this error.
The golden rule is - any mod classes which are accessed on the server side should never refer to vanilla client-side-only classes or methods. It doesn't matter if the code is never called (eg by wrapping it in .isRemote checks), the mere act of loading the server-side class will trigger this error.
Vanilla client-side-only classes should only be referred to by mod client-side-only classes.
May be relevant: http://www.minecraftforge.net/forum/index.php?topic=23724.0
That took a while, but I found it. Turns out you can't @SideOnly(Side.CLIENT)
a field declaration-and-assignment.
Sure that was the latest commit by @unpairedbracket you used? Testet it some hours ago, it works fine on server now for me.
Still occurring for me, actually: http://pastebin.com/fgqmFnZi
I've experiencing that singleplayer running thru eclipse works fine when the server whould crash. And singleplayer is client + server right? So i think that may be the case.
Yeah, I'm definitely using the very latest commit. Maybe it's a problem with my environment...
EDIT:
Do @SideOnly annotations not compile when running through eclipse? It seems like they aren't being acknowledged.
@aidancbrady You've accepted the EULA right? The eula.txt file in the eclipse folder needs to be set to true.
It was working for me @aidancbrady. You should probably set up a server environment and link in the files from the output directory of gradle builds with ln or mklink (depending on if you're on windows or a unix system). Just to test things. I've never really fully trusted the dev environment "runners"
Definitely accepted the EULA :)
If anything I'll probably switch to IntelliJ like I said, I've wanted to do that for a while.
careful with that, it sometimes puts things in the gradle build directories that don't belong there XD
@aidancbrady I'm not sure about eclipse - I switched over to IntelliJ IDEA when ForgeGradle came in. They definitely behave in IDEA, and I see no reason why they wouldn't in Eclipse as well.
Alright, frustrating. I need to consider setting up IntelliJ - eclipse is become a bit antiquated.
@aidancbrady Tested latest commit with Forge 1291 on server, works great.