Mekanism

Mekanism

111M Downloads

[8.0.0] Client-side code being accessed by server causes crashes

halvors opened this issue ยท 19 comments

commented

This is still crashing: http://pastebin.com/3EzDbvYh

commented

Simular to "closed" issue #2226

commented

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.

commented

That took a while, but I found it. Turns out you can't @SideOnly(Side.CLIENT) a field declaration-and-assignment.

commented

This should now be fixed

commented

Nive :-)

commented

Sure that was the latest commit by @unpairedbracket you used? Testet it some hours ago, it works fine on server now for me.

commented

Still occurring for me, actually: http://pastebin.com/fgqmFnZi

commented

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.

commented

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.

commented

@aidancbrady You've accepted the EULA right? The eula.txt file in the eclipse folder needs to be set to true.

commented

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"

commented

I mean, they SHOULD work in principle, but sometimes they miss bugs.

commented

Definitely accepted the EULA :)
If anything I'll probably switch to IntelliJ like I said, I've wanted to do that for a while.

commented

careful with that, it sometimes puts things in the gradle build directories that don't belong there XD

commented

Same. You're positive it works on a dedicated server though, out of eclipse?

commented

@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.

commented

Alright, frustrating. I need to consider setting up IntelliJ - eclipse is become a bit antiquated.

commented

@aidancbrady Tested latest commit with Forge 1291 on server, works great.