Jump to content

java.lang.ClassNotFoundException:net.minecraft.client.gui.inventory.GuiContainer


Recommended Posts

Posted

I got this wierd error (probably) after sending a normal packet from clicking something in the gui to the server.

line 48: "There was a critical exception handling a packet on channel Assembly"

 

http://pastebin.com/A28vLvct

 

Packet sending code:

Assembly.instance.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER);
Assembly.instance.channels.get(Side.CLIENT).writeOutbound(new PacketSorter(this));

 

The error only occurs on the server (not when playing in singleplayer)

Posted

From the looks of the error log and your packet class, it seems that netty is trying to create your server side packet when it encounters a CNF error searching through your constructors. One of your constructors requires a GuiAssemblySorter instance... that is where the error comes in, as this class does not exist server side as far as I can tell.

Why not try and put a @SideOnly(Side.CLIENT) annotation on that specific constructor. It may fix it because then it would not find that constructor on the server side (which it correctly should not).

Posted

From the looks of the error log and your packet class, it seems that netty is trying to create your server side packet when it encounters a CNF error searching through your constructors. One of your constructors requires a GuiAssemblySorter instance... that is where the error comes in, as this class does not exist server side as far as I can tell.

Why not try and put a @SideOnly(Side.CLIENT) annotation on that specific constructor. It may fix it because then it would not find that constructor on the server side (which it correctly should not).

 

You're right, I had those two constructors in PacketSorter, and the SideOnly annotation fixed it:

public PacketSorter() {
}

@SideOnly(Side.CLIENT)
public PacketSorter(GuiAssemblySorter gui) {
active = gui.active;
x = gui.tile.xCoord;
y = gui.tile.yCoord;
z = gui.tile.zCoord;
}

 

Thank you <3

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.