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

Improves the Bukkit detection as a core mod. #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brunoxkk0
Copy link

Instead of using the World class to detect if it's a Bukkit core mod, it's safer to use the DyeColor class.
Using this class shouldn't break Bukkit itself.

That will fix #33

@mitchej123
Copy link
Contributor

I'm not entirely following, what's the problem with using World?

Also is DyeColor there on the various forks, like thermos, etc?

@brunoxkk0
Copy link
Author

It fixes the mentioned issue #33. We don't know why it happens, but loading Bukkit classes too early does cause issues with plugins and breaks reflection. Alternatively trying to detect bukkit without loading classes should be safer.

And about the second question, yes it will work on detecting all bukkit-like implementations.

@mitchej123 mitchej123 requested a review from a team October 15, 2024 18:52
@mts2200
Copy link

mts2200 commented Oct 16, 2024

We don't know why it happens, but loading Bukkit classes too early does cause issues with plugins and breaks reflection.

This happens because Bukkit refers to Minecraft classes by notch/nms names, mods do this using SRG names. Initially Minecraft is still covered with notch names, Forge changes them at runtime to SRG using DeobfuscationTransformer and FMLRemappingAdapter. Judging by the stacktrace from the issue, the person still has Notch names,
although it should have changed to SRG. If we decompile org.bukkit.World (I took it from Crucible), then there will be just the class that was not found in runtime:
image

I dont know how Thermos/Crucible transform Bukkit NMS names to SRG, but its not working there.

@brunoxkk0
Copy link
Author

It does not transform anything, All bukkit related code is written under the patch dev workflow forge has and reobfuscated like a normal forge release. To go more into details we don't know why loading that class too early skips that deobfuscation step, nor why the server still works if that method was actually missed which should utterly break bukkit.

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

Successfully merging this pull request may close these issues.

Powenbt incompatibility
4 participants