Jump to content

[SOLVED][1.8] [SimpleNetworkWrapper] Crash when sending packet.


Recommended Posts

Posted

I am trying to send a packet from the client to server, but it crashes to the main menu, and minecraft says:"Connection Lost / A fatal error has occured, this connection is terminated"

with this stacktrace:

 

  Reveal hidden contents

 

 

My code:

mod_Deconstruction.java:

 

  Reveal hidden contents

 

 

PacketIndex.java:

 

  Reveal hidden contents

 

 

ContainerDeconstructionTable.setCurrentRecipeIndex():

 

  Reveal hidden contents

 

 

GuiDeconstructionTable:

 

  Reveal hidden contents

 

 

 

Posted

Question:

Why is this line here?

MinecraftForge.EVENT_BUS.register(this);

 

Your main mod is not, and should not be, an event handler.  Yes, it has @EventHandler annotations, but the event bus looks for @SubscribeEvent (which you do not have), so why are you trying to subscribe your main class to the event bus?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
  On 4/9/2015 at 3:28 PM, diesieben07 said:

Every IMessage class needs a default constructor (no arguments) so that FML can create an instance of it when the packet is received.

 

Thanks! this worked.

 

-bdkuhman

Posted
  On 4/9/2015 at 3:22 PM, Draco18s said:

Question:

Why is this line here?

MinecraftForge.EVENT_BUS.register(this);

 

Your main mod is not, and should not be, an event handler.  Yes, it has @EventHandler annotations, but the event bus looks for @SubscribeEvent (which you do not have), so why are you trying to subscribe your main class to the event bus?

 

I actually do have a SubscribeEvent to RenderGameOverlayEvent, but just did not include it in the post.

Posted
  On 4/9/2015 at 3:38 PM, bdkuhman said:

I actually do have a SubscribeEvent to RenderGameOverlayEvent, but just did not include it in the post.

 

Create a new class.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

Announcements



×
×
  • Create New...

Important Information

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