Sign in to follow this  
Ignacius

Question about decompiling the JARs

Recommended Posts

So with the Wurm Unlimited server codebase, it was recommended to me to use the Procyon decompiler for a source-code reference to aid in writing mods.

 

What I'm currently wondering is, would turning around and re-compiling these .java source files and wrapping them up in a new JAR work and be usable? Are there any issues that arise in doing so, e.g. anything lost?

 

This is probably one of the first times I've ever worked with decompiled source and javassist so I'm just wondering how reliable that process is / if anything is lost in doing so. I'm sure of course that recompiling it would work, but wanted to see if anyone else had experience with this and if any problems arose as a result.

Edited by Ignacius

Share this post


Link to post
Share on other sites

De-compiling the entire jar, then compiling it again would most likely cause issues. When de-compiled, no matter what program you use, you will get errors on the more complex class files. If not properly fixed, you will encounter many game errors if the server even starts at all. I would recommend only recompile the files you want to change, then add them to the vanilla server.jar overwriting them.

Share this post


Link to post
Share on other sites

Better still don't change the original code directly, as it means anytime there is an update your changes get lost. Instead use the techniques that Java provides to override and modify the behavior of the classes. While this doesn't guarantee that things won't break with an update, it greatly reduces the chance.

Share this post


Link to post
Share on other sites

Do not change the server.jar file. Use the modloader to modify the code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this