Making ModLoader mods with MCP

From Mod Coder Pack

Jump to: navigation, search


This tutorial is on how to use modloader with MCP.

NOTE: As of MCP v2.9a, ModLoader support is included.

Contents

Requirements

  • Meeting the Prerequisites.
  • Minecraft binaries.
  • The MCP archive.
  • The Modloader archive, available at Risugami's thread.
  • If you want to use other libraries known to work in MCP like spawnlist, audiomod, grab those as well.

Setting up MCP

The first thing you want to do is extracting the MCP archive.

Now copy all required files from ~/.minecraft (or %appdata%\.minecraft if you are windows user), as stated in the readme, into mcp/jars/.

Preparing the minecraft.jar

Extract the contents of the Modloader zip to a folder of your choice, as well any other supported mods you wish to add.

Open your copied version of minecraft.jar in mcp/jars/bin with a capable archive editor like 7zip on Windows, or the archive manager of your choice on Linux. Add the Modloader etc files you extracted earlier to this minecraft.jar.

Decompiling

Before you start modding you want to update the mappings, go into your MCP base folder and run updatemcp.

Run decompile.

The logs might complain about some HUNKs failing, you can ignore these (especially the ChunkProviderLoadOrGenerate ones) for the most part, unless they occur in huge numbers. These happen because ModLoader or other mods you added to minecraft.jar modify exisiting classes and cause the patches to partially fail.

If you get any glaring problems, make sure to contact the relevant IRC channels.

Just for testing, try to recompile. This shouldn't give you any drastic errors or warnings. If it does, you know what to do.

Testing

As of ModLoader 1.2_02v4, ModLoader mods should work in MCP's test_game. However, if for some reason your mod depends on an actual minecraft.jar environment (like using reflection tailored to obfuscated minecraft), you need to follow these steps:

  • Recompile. Fix errors until recompile gives no errors. Repeat.
  • Reobfuscate your recompiled files by running reobf. This should put final classes in reobf/minecraft.
  • Take these files and install them in your minecraft.jar like any other mod (make sure META-INF is deleted).
  • Run Minecraft.
Personal tools
Categories