Kraethi Posted October 15, 2013 Share Posted October 15, 2013 Hey there, new to modding but not to minecraft. One of my favorite mods is lagging behind in development, so I decided I'd give a shot at updating it from 1.5.2 to 1.6.2 myself. I figured out how to set up MCP and forge, and have the mod itself all decompiled and added. The majority of the java errors, however, aren't related to new methods. In the section at the top of just about every .java file (I'm also a java noob, but I don't really think this issue is so java-related) there are several lines that start with "import". Some of these have normal things following them, like "cpw.mods.fml..." (etc). The majority of the java errors are from lines like "import aab" and "import dk", which gives me "the import aab cannot be resolved" which in turn messes everything up further down in the code when it tries to use "aab" or whatever. The only thing I can think of is that these correspond to the .class files in the original, compiled and obfuscated minecraft.jar. What can I do to figure out what on earth these are supposed to mean and fix them? I apologize in advance if this turns out to be a stupid question, as I couldn't find any evidence of anyone else having had this problem before. Quote Link to comment Share on other sites More sharing options...
Kraethi Posted October 15, 2013 Author Share Posted October 15, 2013 /cough/ so I'm a bit of an idiot, I found the file in MCP containing all the names of the classes. Should I replace, say, every "aab" with "net.minecraft.item.crafting.RecipesMapCloning", for example? There also seems to be some ambiguity. Is there any way I can iron this out with certainty? Quote Link to comment Share on other sites More sharing options...
DrEinsteinium Posted October 15, 2013 Share Posted October 15, 2013 So it sounds like you are dealing with "obfuscated" class files. When Minecraft recompiles it's code it uses a system that essentially makes all class names, methods and fields almost unusable by renaming and refactoring them to names such as aab, aac, ect. This would explain why your import statements would include these weird names. But as for fixing these, it's nearly impossible with the information you have given us so far. What mod is it that you are trying to update? Is it open source? If not, where did you get it's source from? Did you install Forge correctly? Without this information none of us can really help you. Cheers, Quote Follow me on twitter! @keepablock Read up on whats new! www.catacombs.co http://electronic-chronic.com/assets/keep-a-block/wikilink/wikilink_logo.png[/img] Link to comment Share on other sites More sharing options...
agaricus Posted October 15, 2013 Share Posted October 15, 2013 the file in MCP containing all the names of the classes. Should I replace, say, every "aab" with "net.minecraft.item.crafting.RecipesMapCloning", for example? You can use MCP to deobfuscate by adding your mod classes to the Minecraft jar and then decompiling, or (perhaps easier) deobfuscate by feeding your mod jar to a tool like BON. There also seems to be some ambiguity. Is there any way I can iron this out with certainty? You may be seeing apparent ambiguity in the obfuscated code since the Java runtime additionally uses type information to uniquely identify symbols. Nothing is stopping the bytecode from using the same name if it unique according to the JVM, for example see: https://github.com/MinecraftForge/FML/issues/210 (since fixed). Additionally the same name can be reused in a different context, so it cannot be substituted purely textually. But FML, MCP, BON, etc. all deobf properly and reliably. Quote Link to comment Share on other sites More sharing options...
Kraethi Posted October 15, 2013 Author Share Posted October 15, 2013 Thank you both for your help! You were right about the obfuscated class files. As it turns out, each corresponded to a single .java file in the source code, so that cleaned itself up nicely. I have another, unrelated problem now, having to do with refreshBoundTexture() and GUI tooltips but I'll wait until I'm back on my desktop to post a new topic. Thank you both! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.