Jump to content

Recommended Posts

Posted

I have finished updating my mod to 1.3.2 using Forge 4.0 (#217) and wanted to ensure everything works with the newest build. On the Client, everything works fine, but as soon as I want to spawn something, the server crashes with following error log:

 

  Reveal hidden contents

 

 

I'm really wondering why it's crashing, because every variable and every code I'm using only for the client is packed into an if statement ala

if(FMLCommonHandler.instance().getSide().isClient) {
    // code only for client
}

 

and it worked perfectly in rev. 217 of Forge, so I think it's probably a bug somewhere.

 

 

Here's one of my entity classes which causing that error:

https://gist.github.com/42b4c72c09eb508ec1b4

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

You can't have any client imports in your common or server files.

It doesn't matter if they are used or not, just trying to load them will kill the server.

 

Go through all of your common and server files and remove all client imports.

The errors you get is code you need to pass through your proxy.

Posted

Okay, I have rewrote all my common files so they call my proxy methods now.

That means instead

Minecraft.getMinecraft.theWorld

it calls now

CSM_ModRegistry.proxy.getClientWorld()

for example, which returns null on a server and returns the client world on a client.

Also I've removed all imports to client stuff in my common files. Works perfectly now.

 

But I'm wondering why it did work on forge rev.217  ???

 

 

Anyway, I'm looking forward to update my mod ASAP, Thanks @all :D

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Because we taged all the client classes themselves as being client only so that it would crash during debug time.

Seems it worked and you delt with it at debug time rather then at release time.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.