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

Reobfuscation Problems (Solved!)

Started by TehSomeLuigi, 18 December 2012 - 04:53 AM
TehSomeLuigi #1
Posted 18 December 2012 - 05:53 AM
Edit2:
Solved myself:

And now I got the error again. But I had an idea, and so far it has seemed to have worked:

If you get an error when reobfuscating that says one of the Minecraft source classes is missing "net/minecraft/src/ItemStack" for me when BON'd ComputerCraft is in your libs, here is how you can fix it:

1- Pass the ComputerCraft mod file through immibis' Bearded Octo Nemesis. Put the resulting jar in /mcp/jars/mods/.
(do not put it in libs)
You can now do your testing with ComputerCraft installed.

2- Grab the ComputerCraft API. Put what is in ccapi.zip/src/ into mcp/src/common/, so you end up with a dan200 folder in there.


3- Go in to /common/dan200/turtle/api/ITurtleAccess.java and find the getPosition() method. Change "public net.minecraft.src.Vec3D getPosition();" to "public net.minecraft.src.Vec3 getPosition();" (I assume a mapping update broke this and renamed the Vec3D)..

4- You should be able to use the API correctly, and do your testing working with ComputerCraft OK too.

5- When you release your addon, you can delete the computercraft API files from your mod zip/jar.

6- Should be good.

I believe the reason you get those errors as stated above is because at reobfuscation the jars in the libs folder cannot be tested against the minecraft classes. I'm not entirely sure, so don't take my word for it.
Cloudy #2
Posted 18 December 2012 - 12:41 PM
This has nothing to do with CC.
TehSomeLuigi #3
Posted 18 December 2012 - 12:43 PM
Hmm. I'll look a bit further into it. This has only been happening since I started the CC stuff. I wasn't quite sure.
TehSomeLuigi #4
Posted 18 December 2012 - 01:21 PM
I've thought a bit and decided this is probably a good time to rewrite the code I have because I followed a pretty bad tutorial & everything is messy. Sorry for wasting your time, maybe I'll be back later with a result I'll be able to share.
TehSomeLuigi #5
Posted 19 December 2012 - 06:21 AM
And now I got the error again. But I had an idea, and so far it has seemed to have worked:

If you get an error when reobfuscating that says one of the Minecraft source classes is missing "net/minecraft/src/ItemStack" for me when BON'd ComputerCraft is in your libs, here is how you can fix it:

1- Pass the ComputerCraft mod file through immibis' Bearded Octo Nemesis. Put the resulting jar in /mcp/jars/mods/.
You can now do your testing with ComputerCraft installed.
(do not put it in libs)

2- Grab the ComputerCraft API. Put what is in ccapi.zip/src/ into mcp/src/common/, so you end up with a dan200 folder in there.



3- Go in to /common/dan200/turtle/api/ITurtleAccess.java and find the getPosition() method. Change "public net.minecraft.src.Vec3D getPosition();" to "public net.minecraft.src.Vec3 getPosition();" (I assume a mapping update broke this and renamed the Vec3D)..

4- You should be able to use the API correctly, and do your testing working with ComputerCraft OK too.

5- When you release your addon, you can delete the computercraft API files from your mod zip/jar.

6- Should be good.

I believe the reason you get those errors as stated above is because at reobfuscation the jars in the libs folder cannot be tested against the minecraft classes. I'm not entirely sure, so don't take my word for it.
immibis #6
Posted 19 December 2012 - 01:10 PM
Put the reobfuscated jar in jars/mods instead
TehSomeLuigi #7
Posted 20 December 2012 - 09:09 AM
Put the reobfuscated jar in jars/mods instead

Yup, that's what I did.

Also, thanks for your tool :)/>.