Jump to content

Server attempting to load Client-Only class


shieldbug1

Recommended Posts

I'm using IMessage and SimpleNetworkWrapper to sync things between client and server right now, whenever I try to run a dedicated server it crashes between PreInitialisation and Initialisation, because it tries to load EntityClientPlayerMP on the server side.

 

 

Registering the message (this is the cause of the exception):

NETWORK.registerMessage(MessageSyncEPP.Response.Handler.class, MessageSyncEPP.Response.class, 1, Side.CLIENT);

 

The offending line (if I remove this line, it works fine):

ExtendedPlayer properties = ExtendedPlayer.get(Minecraft.getMinecraft().thePlayer);

 

The offending line is in my onMessage method of my Response.Handler class.

 

From my understanding, registerMessage takes a handler, the packet it handles, an id, and the side it should be handled on.

 

I know Minecraft.getMinecraft().thePlayer is Client only, but shouldn't the onMessage only be called on the client side (since I used Side.CLIENT as the last parameter in registerMessage)? On top of that, why is the onMessage being called in the preinitialisation stage, and why isn't it appearing in the stack trace?

BEFORE ASKING FOR HELP READ THE EAQ!

 

I'll help if I can. Apologies if I do something obviously stupid. :D

 

If you don't know basic Java yet, go and follow these tutorials.

Link to comment
Share on other sites

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.