Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default package affects mod classes #37

Open
FyberOptic opened this issue Jan 30, 2015 · 2 comments
Open

Default package affects mod classes #37

FyberOptic opened this issue Jan 30, 2015 · 2 comments

Comments

@FyberOptic
Copy link

I've been working with loading Minecraft 1.2.5 mods after deobfuscating them with BON, and after having some class loading issues due to the package of some of the mod's classes, I eventually realized that it was the JARs themselves at fault. BON had placed the unpackaged classes in the JARs into "net.minecraft.src".

This isn't a problem for newer mods, where everyone defaults to using a package, and Forge scans the JAR for them. But for these old ones that use the ModLoader technique it's obviously an issue. I realize that it's adding a default package for handling Minecraft's obfuscated base classes, and I also realize that BON can probably be used to remap the Minecraft JAR itself, so not repackaging classes in the input JAR by default isn't necessary the answer.

So unless there's something I'm overlooking, I guess a viable solution would just be to add a config option on whether or not to repackage classes found in the input JAR, and have it still do so by default to retain compatibility.

@immibis
Copy link
Owner

immibis commented Jan 30, 2015

This is how things worked back in 1.2.5 and earlier. People put their classes in net.minecraft.src, and the obfuscator moved them to the default package. So, logically, deobfuscation should move them back.

@FyberOptic
Copy link
Author

The problem though is that classes which are already in packages in the JARs aren't moved, so the mods get confused because their main "mod_" and related classes are repackaged and the rest aren't. BuildCraft for example detects this and tries to behave as if it's running in a development environment by prefixing "net.minecraft.src" to all other class loads.

I realize this is more of a fringe issue, I simply removed the default package in BON's code and recompiled, and it's fine now for my case. But it caused enough head-scratching for me in figuring out what was going on that I thought I'd bring it up in case you feel a solution is warranted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants