Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to make mods for 1.13

Decompiling

  1. Clone MCPConfig from the GitHub repository.
  2. In the root project directory, run gradlew :1.13:projectClientApplyPatches if you want to make a client side mod, or gradlew :1.13:projectServerApplyPatches if you want to make a server side mod.
  3. Naviage into versions/1.13/projects/server (or client). There are a couple of fixes necessary to get the code to compile:
    1. There is a missing class mcp.MethodsReturnNonnullByDefault which you will have to manually add. A copy can be found here.
    2. If you're making a server-only mod, the anonymous classes in net.minecraft.item.ItemClock and net.minecraft.item.ItemCompass need to be modified to override the method in net.minecraft.item.IItemPropertyGetter. This is never actually called on the server so you can make a dummy implementation.
  4. Copy versions/1.13/projects/server (or client) into a separate project folder so you still have a clean copy of 1.13.
  5. TODO: convert mappings from SRG to MCP (optional).
  6. Inside the new project folder you created, run gradle eclipse to work in Eclipse, or gradle idea to work in intellij. For this you need to have Gradle installed.

Import this project into your IDE and start modding. To test out your mod you only need to launch in the normal way the IDE provides.

Recompiling

  1. Once you're done, run gradle build inside your modded project directory. This produces a JAR inside build/libs.
  2. Also run gradlew build in the unmodified project directory (versions/1.13/projects/server) and note the produced JAR inside build/libs.
  3. Get a SpecialSource JAR if you haven't already
    1. Clone SpecialSource from its GitHub repository.
    2. In the SpecialSource directory run mvn package. This requires you to have Maven installed.
    3. You will find the built SpecialSource JAR in target/SpecialSource-1.8.5-SNAPSHOT-shaded.jar.
  4. Create reverse mappings using my python script in the same directory as joined.tsrg. This will create a new file called reversed.tsrg.
  5. Run SpecialSource on each of the unmodded and the modded server JARs, using the following command: java -jar SpecialSource.jar --in-jar path/to/server.jar --out-jar path/to/obf.jar --srg-in path/to/reversed.tsrg
  6. Filter out only the modified classes using my python script. It takes three arguments, the unmodified obfuscated JAR, the modified obfuscated JAR and the output JAR that will contain only the modified classes.
  7. Rename the output JAR to something more presentable, and you're ready to distribute!
@Equinox-

This comment has been minimized.

Copy link

Equinox- commented Aug 28, 2018

Here's some hacks I put together to get it from SRG to MCP and back from MCP to Notch.
https://cdn.discordapp.com/attachments/483607315593822223/483631476575830016/srg_to_mcp.zip

@danielt3131

This comment has been minimized.

Copy link

danielt3131 commented Aug 31, 2018

The MCP to Notch hack fix doesn't work on Mac OS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.