This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
absorr's profile picture

[TUTORIAL] How to use mods that do not give source

Started by absorr, 01 October 2012 - 02:30 PM
absorr #1
Posted 01 October 2012 - 04:30 PM
Perhaps you want to make a mod that combines Mod X with ComputerCraft, well it is a lot simpler then you think. Just follow these steps! NOTE: You must be using Eclipse.

1. Select the Project in Package Explorer (in 1.2.5 this would be "Client" or "Server". In 1.3.2, this would be "Minecraft")
2. Go to File > Properties > Java Build Path > Libraries
3. Click "Add External JARs…" and open the mod



Now you can view the classes for the mod. They can be found in "Referenced Libraries" in your project. You may notice that classes default to minecraft, like Block and ItemStack, use their obfuscated names. This will prevent you from recompiling your mod because of the errors that will pop up. It is best to create an empty version of this file to throw it off your tail, here is an example for NEI.
Spoiler

package codechicken.nei.recipe;
import java.util.*;
import net.minecraft.src.GuiContainer;
import net.minecraft.src.ItemStack;
public class FurnaceRecipeHandler {
public class SmeltingPair {
  public SmeltingPair (ItemStack in, ItemStack out)
  {
  
  }
}

public Set arecipes;
public Class<? extends GuiContainer> getGuiClass() {
  // TODO Auto-generated method stub
  return null;
}
public String getRecipeName() {
  // TODO Auto-generated method stub
  return null;
}
public void loadCraftingRecipes(String outputId, Object[] results) {

}
}
Something like this will make MCP think that the mod will work. Do not run it in Eclipse while these files exist because Minecraft can not actually use these, they are to throw MCP a bone and shut up. You don't have to have all methods in the decoy, you just need enough for Eclipse and MCP not to light up with errors.
immibis #2
Posted 02 October 2012 - 02:26 AM
Option 2: Use Bearded Octo Nemesis to deobfuscate ComputerCraft. Because of unknown bugs in BON, you also need to make net.minecraft.src.GuiButton.width public, and the texture on the front of the computer will be broken.
You can then add the deobfuscated mod to the Eclipse build path, and run it from within Eclipse.
absorr #3
Posted 02 October 2012 - 02:34 AM
Option 2: Use Bearded Octo Nemesis to deobfuscate ComputerCraft. Because of unknown bugs in BON, you also need to make net.minecraft.src.GuiButton.width public, and the texture on the front of the computer will be broken.
You can then add the deobfuscated mod to the Eclipse build path, and run it from within Eclipse.
I can see why you got the title Lua God. My tutorial is not specific to ComputerCraft though. I'm not saying yours would not work with other mods, and in fact the way you worded it makes it sound easier and I am highly considering using that instead, but I doubt making GuiButton.width public will solve it if I were to do it to a different mod. Basically, there would be kinks to work out. Even with the kinks, yours is better. Thank you for sharing your knowledge.
immibis #4
Posted 02 October 2012 - 03:28 AM
Option 2: Use Bearded Octo Nemesis to deobfuscate ComputerCraft. Because of unknown bugs in BON, you also need to make net.minecraft.src.GuiButton.width public, and the texture on the front of the computer will be broken.
You can then add the deobfuscated mod to the Eclipse build path, and run it from within Eclipse.
I can see why you got the title Lua God. My tutorial is not specific to ComputerCraft though. I'm not saying yours would not work with other mods, and in fact the way you worded it makes it sound easier and I am highly considering using that instead, but I doubt making GuiButton.width public will solve it if I were to do it to a different mod. Basically, there would be kinks to work out. Even with the kinks, yours is better. Thank you for sharing your knowledge.

IC2 and RP2 work perfectly out of the box.
Ryltarr #5
Posted 20 August 2013 - 10:28 PM
Sorry to raise a thread from the dead here, but you can combine mods into one jar in a much easier way than that… Just open them as if they were an archive (I used 7zip, if you don't have that just change the extension to .zip):
  1. Copy the files from one mod's file (.zip or .jar) into one .jar file; make sure to keep all the mcmod.info files and pack.mcmeta files.
  2. Copy the text from the mcmod.info files, and add them to the end of the mcmod.info file which resides in the combined .jar file; do the same for pack.mcmeta files.
  3. Check that all the files are there, and all the text is there for your mcmod and pack files, zip it up or just close if you're using 7zip.
  4. Make sure the extension is .jar… I don't really know why some mods require it and others don't (and I've tried to figure it out)… But any mod will work if the extension is .jar, whereas some won't work if the extension is .zip.
  5. Lastly, make sure that any duplicate Forge mods aren't in the mods folder. If they are in your combined file, and in their own files at the same time in the mods folder Forge will be angry about loading the same mod twice.
This method I tested on Forge for 1.6.2 builds 798, and 804.