Sign in to follow this  
joedobo

Quick video of using Intellij to make a server.jar code change.

Recommended Posts

Seems a lot of folks are having problems with the process of decompile, alter, compile, and drop class in JAR file. In this video I do just that. I'm going to make it so forges and ovens have the same internal volume as a Caravel.


 


- This is the first video I've ever made, please forgive any inconveniences. I know it shows a name, hopefully that is the only privacy issue.


 


- In the beginning of the video at about 0:07 time you'll see I already have the Java SDK. You may have to download Java (NOT JRE) and then use that "New..." button tell Intellij where Java is installed.


 


- In the video when I add "@SuppressWarnings("ALL")" it's not required to do this. Alt+enter while cursor is on a warning is how I opened that menu. Intellij likes to impose certain coding style on you and it flat out blows up with warnings from decompiled WU code. They aren't essential so I suppress them.


 


 


http://screencast-o-matic.com/watch/coX1exhlwe


 


 


In general and not specific to the video.


Intellij will underline things in red if its an error that would result in a failed compile. I just delete any "@nullable" errors. The only other error I've had was in the client.jar -  seasonManager.class.   It had some switch logic which gave some weird decompiled code. It took me a couple hours of google and experiment to fix it.


 


For the most part you don't have to know Java to do what I"m doing here. I"m a total Java Noob. I do have a general idea of programing logic. This knowledge and Intellij's ability to look for connections in the code are what have let me do what I've done so far. 


Share this post


Link to post
Share on other sites

Nice video!


 


I want to emphasize what you state near the end, that while the modification to hardcoded values you do in the video doesn't require programming experience, changing game logic does.  You can get by with Google and experimentation, but taking the time to watch a few online tutorials on basic programming (Java or not, but Java tutorials would make the most sense) would be the first step any non-programmer should take before jumping into modding.


Edited by Ricowan

Share this post


Link to post
Share on other sites

Thank you for the video.  It appears to decompile much better than the JD-GUi i was using. 


Share this post


Link to post
Share on other sites

huge help TY  , I finally got it to work,  now to learn what does what and what we can change ;-)    I found meditation timers, i'm guessing we can edit that.


Share this post


Link to post
Share on other sites

wonderful job even without sound at least you have the decency to not put any cheesy annoying music! very good pace i could follow along with some pausing. I just wanted to add that this works with the inteliJ free community edition. 


 


Now a very special request if at all possible, would definitely benefit the community if you could do a video on how to produce mods to use with ago's modlauncher. 


Share this post


Link to post
Share on other sites

I don't understand the concepts involved with Ago's mod loader well enough to do a tutorial on it. I can do HelloWorld and it is a momentous step going to advanced reflection and code injection via Javassist.


Share this post


Link to post
Share on other sites

Intellij uses fernflower. It seems to work fine for the most part. Although it seems to lose some variable names. Names like "var24" "var25" can be a little confusing.

Edited by Karthannar

Share this post


Link to post
Share on other sites

i had issues  then reinstalled java, JDK and JRE  seems to work now for me,  and your lessons on java, worked, 


 


i found out why i had such issues, i was packing the dir back to the jar file,  but it didn't overwrite files correctly,  found it beter to rename jar to zip, place new files in and rename to jar, works great now, at least the forge with 100 ore,  forgot to test the backpack, but it make caulron fit 100 ore incase backpack wont work.


 


but huge thanks...


Share this post


Link to post
Share on other sites

How do i choose the correct Project SDK like in the Video?


I am a total Java Noob and can't get it startet lol...


 


j1twqg1.png


 


j2psrqb.png


Share this post


Link to post
Share on other sites

You should select the JDK folder and not the JRE folder


Share this post


Link to post
Share on other sites

THIS IT WHAT I HAVE BEEN LOOKING FOR SINCE THIS GAME WAS RELEASED!!! YESSSSSSSS!!! AND THANK YOU!!!!!!

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