Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Jar file and editing it  (Read 2066 times)

Oya

  • Ensign
  • *
  • Posts: 8
    • View Profile
Jar file and editing it
« on: September 12, 2022, 08:06:08 AM »

Does anyone have any insight on opening a jar file so I can edit values within it and save it so the changes are reflected in-game? Thanks in advance. (P.S I already have installed IntelliJ and eclipse if that helps)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Jar file and editing it
« Reply #1 on: September 12, 2022, 06:08:48 PM »

You want to use your IDE to recompile the source into a new .jar, and replace the old .jar with it. Most mods include the source in the download somewhere, or on a Github or Bitbucket repository; else decompiling the original .jar with a tool like Java Decompiler works, but not as well for any kind of large modification.

If you already know how to use IntelliJ or Eclipse then go ahead and use either, else there are tutorials like the wiki's Getting started with mod programming.
Logged

Oya

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Jar file and editing it
« Reply #2 on: September 12, 2022, 06:56:53 PM »

Thank you for the reply and helped pointer. Appreciate you!
Logged

Zr0Potential

  • Commander
  • ***
  • Posts: 107
    • View Profile
Re: Jar file and editing it
« Reply #3 on: September 12, 2022, 07:16:09 PM »

I'm not smart enough to figure out Intellij and all that jazz so I just use Recaf

Just load the .jar file you wanted to edit (don't forget to make a backup) and do your thing, save/compile it, then export it to a new .jar file
Logged

Oya

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Jar file and editing it
« Reply #4 on: September 17, 2022, 12:56:27 PM »

Wow, thanks chief, this looks to be faster for making slight tweaks. Appreciate your input chief.
Logged

Jakened

  • Ensign
  • *
  • Posts: 23
    • View Profile
Re: Jar file and editing it
« Reply #5 on: August 18, 2023, 10:06:48 PM »

did you actually managed to change the value with recaf? when i tried to use mine it revert back to original number (like changing the bonus production from 1 to 5, but after exporting the jar it revert back to 1)
Logged