Jump to content

[1.12] "Converting" mod to be multiplayer-compatible?


Recommended Posts

I've compiled my mod, and I've thrown it on a server I'm hosting, and I'm running into NoSuchMethodExceptions for client @SideOnly methods, and NoClassDefFoundError: net/minecraft/client/Minecraft, which I believe tells me I've created a client-only mod. I don't know how to make it multiplayer-compatible though...how do I do that?

Link to comment
Share on other sites

It's an entity that can be controlled like a boat, the method simply gets the user's input and sets booleans accordingly, taken from the EntityBoat class.

@SideOnly(Side.CLIENT) public void updateInputs()
    	leftInputDown = GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindLeft);
    	rightInputDown = GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindRight);
    	forwardInputDown = GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindForward);
    	backInputDown = GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindBack);

Strangely enough, I didn't find a call to the EntityBoat's version of the method anywhere within that class, so I added one in mine elsewhere in the code

 public void onUpdate()
    	previousStatus = status;
    	status = getRaceCartStatus();

 which is causing the NoSuchMethodException. If I take out that call, I get the NoClassDefFoundError, looking for net/minecraft/client/Minecraft

Link to comment
Share on other sites

For future reference, if you're using Eclipse as your IDE, you can right-click any field or method name and click "Open Call Hierarchy", and Eclipse will show you exactly what classes are referencing the field or calling the method, and where. It's a very useful research and debugging tool :)

Whatever Minecraft needs, it is most likely not yet another tool tier.

Link to comment
Share on other sites

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.

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.