Jump to content

How do I debug a server side mod?


Recommended Posts

I'm working on a server-side mod but I can't figure out how to debug it.

 

When I run "startserver.bat" and then start the client through Eclipse in debug mode, it tells me that "the mod testBlocks was not found on the server"...

 

I've tried the following:

 

@NetworkMod(clientSideRequired=false, serverSideRequired=true)

@NetworkMod(clientSideRequired=true, serverSideRequired=true)

 

but for whatever reason, the server doesn't see the mod's source code.

Link to comment
Share on other sites

Eclipse has a server launcher, also you have the @Mod annotation and don't have a stray @SideOnly(Side.CLIENT) correct?

 

I do have the @Mod annotation and I actually don't have any Side.CLIENT yet and I have @NetworkMod with clientSideRequired=false, serverSideRequired=true.

 

Also I assume when you say Eclipse has a launcher that you're not talking about the batch file?

Link to comment
Share on other sites

  • 4 months later...

I know this is an old topic but it's still relevant since I actually took a break from modding.

 

I'm unable to get the server running in Eclipse because in my modLoad() function it crashes when it tries to create an instance of my block:

 

smartlightBlock = new BlockSmartLight(cfg.getBlockId(false), false);

 

cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/multiplayer/WorldClient

Link to comment
Share on other sites

I believe that the server doesn't actually handle blocks/items and such... Don't quote me on that though.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

I believe that the server doesn't actually handle blocks/items and such... Don't quote me on that though.

 

That may be true, not sure myself.

 

I technically don't want to debug the server. What I want to do is debug my mod while connected to a server. Problem is I can't start the server through Eclipse and if I start the server with "startserver.bat" (in the MCP folder) and then run the client through Eclipse it can't connect due to "missing mods".

 

I don't see how I could be missing mods since the MCP server only runs Forge which is also what's running in Eclipse.

Link to comment
Share on other sites

Try this and see if this works for you:

 

Save all the code and run the client to make sure it compiles and runs in SSP mode.  Exit.

 

Open the command prompt/shell etc and go into the forge/mcp directory and run the recompile script, then the reobsfucate script.  After doing that you can run the server from eclipse and then start the client from eclipse afterwards and connect to the server.

Link to comment
Share on other sites

In Eclipse next to the run button there should be a little down arrow ( right hand side of the button ). Click that and it will do a drop down menu with two options, Client and Server ( Note this is only when in the MCP environment ). All you have to do is click the Server option and it will launch the server. Then, once it is running, click that arrow again and run the client in debug mode ( using the arrow to the right of the debug option of course :P ) and then connect to the server. Easily done.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

@Axlen

 

Thanks but I was looking to be able to test without having to compile, reobfuscate, etc.

 

@Mew

 

Right, that's when it crashes. As soon as I launch the server from within Eclipse it throws the NoClassDefFoundError about "WorldClient" that I mentioned earlier. It is pointing to my mod's base file at the line that creates the "new BlockSmartLight()". Strange thing is that in my constructor I don't do anything except set the creative tab.

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.

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.