Jump to content

Recommended Posts

Posted

I'm trying to run my mod as a server and connect to it as a client (it's been running fine when I just run it as a client and play singleplayer), and I'm getting this exception when I try to connect. The full console output:

  Reveal hidden contents

The class of the packet which the error refers to:

  Reveal hidden contents

The exception seems to suggest I'm doing something wrong in the read/write methods, but they seem to be perfect mirrors of each other like they should be. Can anyone help?

Posted

Have you registered all of your messages with unique IDs? This can happen when two messages are registered with the same ID and FML uses the wrong message handler on the receiving side.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 2/25/2017 at 5:31 PM, Choonster said:

Have you registered all of your messages with unique IDs? This can happen when two messages are registered with the same ID and FML uses the wrong message handler on the receiving side.

Expand  

Ah, yes I was making a mistake with my registration - I was doing it on one side only, but it needs to be on both, so the IDs were messed up.

 

But now I have a different crash, because most of my server->client packets call client-only things like Minecraft.getMinecraft(), resulting in NoClassDefFoundErrors. What should I do about that?

Posted
  On 2/25/2017 at 5:48 PM, Jay Avery said:

Ah, yes I was making a mistake with my registration - I was doing it on one side only, but it needs to be on both, so the IDs were messed up.

 

But now I have a different crash, because most of my server->client packets call client-only things like Minecraft.getMinecraft(), resulting in NoClassDefFoundErrors. What should I do about that?

Expand  

 

You need to handle any references to client-only classes through your proxy, with methods that return the client player, the client world, etc. In your client proxy, implement these to return the appropriate values. In your server proxy, implement these to throw an exception (because they should never be called on the logical or physical server).

  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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