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

How to properly deobfuscate Computercraft for use in Eclipse (1.55+ only)

Started by Tiin57, 16 July 2013 - 08:26 AM
Tiin57 #1
Posted 16 July 2013 - 10:26 AM
I recommend theoriginalbit's method: http://www.computercraft.info/forums2/index.php?/topic/14131-how-to-properly-deobfuscate-computercraft-for-use-in-eclipse-155-only/page__view__findpost__p__149411

Old method:
SpoilerIf you know how to deobfuscate and just need Computercraft-specific instructions, skip to step 6.
  1. First, of course, you want to download the latest Computercraft.
  2. Then download Bearded Octo Nemesis (BON), a tool developed by immibis to aid in deobfuscation. (https://github.com/i...ed-octo-nemesis)
  3. Create a directory called "deobf" anywhere (not in MCP), and copy the Computercraft zip to it.
  4. Run BON with the command line/terminal; "java -jar BON.jar". (Note that Linux users without desktop environments are on their own.)
  5. Select the copied Computercraft zip as input, then copy the input line to the output line, but modify the output line's file location to read "ComputerCraft${VERSION}-deobf.zip. Select your MCP folder as the MCP folder (You must run reobfuscate.sh/bat before running BON). Start the deobfuscation.
  6. Now, in your IDE, modify net.minecraft.client.gui.GuiButton.width/height to public instead of protected.
  7. Finally, copy the assets folder from the original Computercraft zip to the deobfuscated one.
Now you can put the deobfuscated Computercraft zip in ${mcp-location}/jars/mods/ to run it when testing.

If anything doesn't work, please post below!

THIS METHOD ONLY WORKS FOR CC 1.55+!
Edited on 09 January 2014 - 11:40 AM
Mikeemoo #2
Posted 16 July 2013 - 11:02 AM
If you know how to deobfuscate and just need Computercraft-specific instructions, skip to step 6.
  1. First, of course, you want to download the latest Computercraft.
  2. Then download Bearded Octo Nemesis (BON), a tool developed by immibis to aid in deobfuscation. (https://github.com/i...ed-octo-nemesis)
  3. Create a directory called "deobf" anywhere (not in MCP), and copy the Computercraft zip to it.
  4. Run BON with the command line/terminal; "java -jar BON.jar". (Note that Linux users without desktop environments are on their own.)
  5. Select the copied Computercraft zip as input, then copy the input line to the output line, but modify the output line's file location to read "ComputerCraft${VERSION}-deobf.zip. Select your MCP folder as the MCP folder (You must run reobfuscate.sh/bat before running BON). Start the deobfuscation.
  6. Now, in your IDE, modify net.minecraft.client.gui.GuiButton.width/height to public instead of protected.
  7. Finally, copy the assets folder from the original Computercraft zip to the deobfuscated one.
Now you can put the deobfuscated Computercraft zip in ${mcp-location}/jars/mods/ to run it when testing.

If anything doesn't work, please post below!

You can just click on bon.jar…

in windows, at least!
Tiin57 #3
Posted 16 July 2013 - 01:02 PM
Yes, but I'm just making sure that Linux people can do this too.
immibis #4
Posted 16 July 2013 - 05:25 PM
Is the GuiButton.width thing happening again?
Tiin57 #5
Posted 16 July 2013 - 06:05 PM
Indeed it is.
gudenau #6
Posted 04 August 2013 - 04:12 PM
Never mind, got it to work.
rimp #7
Posted 05 August 2013 - 10:48 PM
I followed all the instructions to the T and everything seemed to go smoothly but when I load the client there is no computercraft. Am I missing an obvious step not mentioned?

EDIT: I figured out how to get it to load but still fail to see it's classes in eclipse.
Edited on 05 August 2013 - 09:33 PM
Tiin57 #8
Posted 05 August 2013 - 11:44 PM
For anyone reading this later, I suspect his problem was not putting Computercraft*.zip in the <mcpdir>/jars/mods/ folder.

That said,
You're not supposed to see the classes in Eclipse. Computercraft is definitely not open source and I do not know how nor would I tell how to view the source code. (That's not some BS disclaimer; I seriously don't know and wouldn't tell if I did.)
ComputerCraftFan11 #9
Posted 07 August 2013 - 02:23 AM
Whenever I load or create a new world, It gives me this error:
Spoiler

2013-08-06 20:24:02 [SEVERE] [Minecraft-Client] Realms: Invalid session id
2013-08-06 20:24:14 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.6.2
2013-08-06 20:24:14 [INFO] [Minecraft-Server] Generating keypair
2013-08-06 20:24:15 [INFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@1ce384af)
2013-08-06 20:24:15 [INFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@1ce384af)
2013-08-06 20:24:15 [INFO] [STDERR] java.lang.NullPointerException
2013-08-06 20:24:15 [INFO] [STDERR]  at dan200.computer.core.JarMount$FileInZip.getParent(JarMount.java:102)
2013-08-06 20:24:15 [INFO] [STDERR]  at dan200.computer.core.JarMount.<init>(JarMount.java:164)
2013-08-06 20:24:15 [INFO] [STDERR]  at dan200.ComputerCraft.createResourceMount(ComputerCraft.java:415)
2013-08-06 20:24:15 [INFO] [STDERR]  at dan200.computer.shared.ItemTreasureDisk.getTreasureMount(ItemTreasureDisk.java:227)
2013-08-06 20:24:15 [INFO] [STDERR]  at dan200.computer.shared.ItemTreasureDisk.registerDungeonLoot(ItemTreasureDisk.java:159)
2013-08-06 20:24:15 [INFO] [STDERR]  at dan200.computer.shared.ComputerCraftProxyCommon$ForgeHandlers.onWorldLoad(ComputerCraftProxyCommon.java:578)
2013-08-06 20:24:15 [INFO] [STDERR]  at net.minecraftforge.event.ASMEventHandler_5_ForgeHandlers_onWorldLoad_Load.invoke(.dynamic)
2013-08-06 20:24:15 [INFO] [STDERR]  at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:39)
2013-08-06 20:24:15 [INFO] [STDERR]  at net.minecraftforge.event.EventBus.post(EventBus.java:108)
2013-08-06 20:24:15 [INFO] [STDERR]  at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:85)
2013-08-06 20:24:15 [INFO] [STDERR]  at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107)
2013-08-06 20:24:15 [INFO] [STDERR]  at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:443)
2013-08-06 20:24:15 [INFO] [STDERR]  at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-08-06 20:24:15 [SEVERE] [Minecraft-Server] Encountered an unexpected exception NullPointerException
java.lang.NullPointerException
at dan200.computer.core.JarMount$FileInZip.getParent(JarMount.java:102)
at dan200.computer.core.JarMount.<init>(JarMount.java:164)
at dan200.ComputerCraft.createResourceMount(ComputerCraft.java:415)
at dan200.computer.shared.ItemTreasureDisk.getTreasureMount(ItemTreasureDisk.java:227)
at dan200.computer.shared.ItemTreasureDisk.registerDungeonLoot(ItemTreasureDisk.java:159)
at dan200.computer.shared.ComputerCraftProxyCommon$ForgeHandlers.onWorldLoad(ComputerCraftProxyCommon.java:578)
at net.minecraftforge.event.ASMEventHandler_5_ForgeHandlers_onWorldLoad_Load.invoke(.dynamic)
at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:39)
at net.minecraftforge.event.EventBus.post(EventBus.java:108)
at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:85)
at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:443)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

I'm using the latest version of forge
Tiin57 #10
Posted 07 August 2013 - 10:25 PM
You copied the assets folder, right?
ComputerCraftFan11 #11
Posted 07 August 2013 - 11:31 PM
You copied the assets folder, right?

Yea
Neonbeta #12
Posted 09 August 2013 - 04:00 AM
Thank you so much for this!

I'm a little rusty from my modloader times, so this is great for me with all the new-fangled stuff :D/>
rimp #13
Posted 10 August 2013 - 03:00 AM
For anyone reading this later, I suspect his problem was not putting Computercraft*.zip in the <mcpdir>/jars/mods/ folder.

That said,
You're not supposed to see the classes in Eclipse. Computercraft is definitely not open source and I do not know how nor would I tell how to view the source code. (That's not some BS disclaimer; I seriously don't know and wouldn't tell if I did.)

The issue was that I forgot to put the .zip suffix on the file after I deobfuscated it. I guess I failed to see the purpose of it and just assumed from other mods that I could. My bad. There goes my idea for a mod then.
theoriginalbit #14
Posted 18 October 2013 - 12:50 PM
An even easier method now is to put ChickenBonesCore into the mcp/jars/mods folder and it will download ChickenBonesLib, this single mod (Lib) allows for an obf'd mod to run in a deobf'd environment.

This allows for testing your mod against any other mod that's installed into the mods folder, without the worry or problem of deobf'ing a mod, and adding it to Eclipse making sure to get package structure perfect.

It makes adding mod support 300x quicker and much easier!

Hope this helps everyone.

— BIT
Tiin57 #15
Posted 18 October 2013 - 04:33 PM
Yes, I recommend theoriginalbit's strategy.
theoriginalbit #16
Posted 18 October 2013 - 04:34 PM
Yes, I recommend theoriginalbit's strategy.
LOL! Very different to what you were saying on IRC :P/>
sci4me #17
Posted 06 March 2014 - 03:22 AM
codechickencore?… or bon…
theoriginalbit #18
Posted 06 March 2014 - 04:22 AM
codechickencore?… or bon…
CodeChickenCore … it downloads ChickenBonesLib which allows obfuscated mods (these are the zips/jars you use normally) to run in a deobfuscated environment.