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

Cannot load on 1.20.4 mojang-mapped Paper server #551

Closed
frengor opened this issue May 4, 2024 · 5 comments
Closed

Cannot load on 1.20.4 mojang-mapped Paper server #551

frengor opened this issue May 4, 2024 · 5 comments
Labels
bug Something isn't working implemented for next release This has been implemented in the current dev build for the next public release

Comments

@frengor
Copy link

frengor commented May 4, 2024

CommandAPI version

9.4.0

Minecraft version

1.20.4

Are you shading the CommandAPI?

No

What I did

I put the mojang-mapped CommandAPI plugin inside the plugins folder and started a 1.20.4 mojang-mapped Paper server.

What actually happened

A bunch of errors appeared in console.

What should have happened

CommandAPI should have loaded without errors.

Server logs and CommandAPI config

Logs: https://paste.gg/p/anonymous/181a4dcd5405451e919576b4857dee81

Other

I originally discovered this while upgrading UltimateAdvancementAPI from using CommandAPI 9.3.0 to 9.4.0. UltimateAdvancementAPI uses the shaded version, but the issue also occurs with the plugin version.

Also, the issue doesn't occur in 1.20.5 and 1.20.6, but it's present in older versions (tested with mojang-mapped Paper 1.19.4 and 1.18.2).

@frengor frengor added the bug Something isn't working label May 4, 2024
@JorelAli
Copy link
Owner

JorelAli commented May 4, 2024

It may have been missed from the documentation, but when shading there's an extra step required in the CommandAPI.onLoad() method. In your CommandAPIBukkitConfig, there's an extra method useMojangMappings(boolean) which needs to be set to true.

@frengor
Copy link
Author

frengor commented May 4, 2024

Definitely missed that, thank you! However, the errors are appearing on both the plugin and shaded versions, not just the latter (the attached logs are from a server with only the CommandAPI plugin). Also, setting useMojangMappings(true) while using the shaded version doesn't fix the errors.


Off-topic question: why is calling useMojangMappings(boolean) required? Isn't using commandapi-bukkit-shade-mojang-mapped instead of commandapi-bukkit-shade enough?

@JorelAli
Copy link
Owner

JorelAli commented May 4, 2024

I would have expected useMojangMappings(true) to have worked, because that sets an internal flag in the CommandAPI to use different field names for certain reflection calls.

I'm currently away for the weekend (and Monday), so won't have an opportunity to investigate this further until early next week.

With regards to why using useMojangMappings is even required, you're right - it shouldn't be. This was a minor implementation detail that was overlooked (we implemented that method first, before we decided to go with separate modules and forgot to remove this extra method and "bake in" the logic directly into the new modules)

@JorelAli
Copy link
Owner

JorelAli commented May 9, 2024

Fixed for 9.4.1, due to release later today. Also fixed the need for useMojangMappings(true) - this will no longer be necessary when using commandapi-bukkit-shade-mojang-mapped

@JorelAli JorelAli added the implemented for next release This has been implemented in the current dev build for the next public release label May 9, 2024
@JorelAli
Copy link
Owner

JorelAli commented May 9, 2024

Fixed in 9.4.1.

@JorelAli JorelAli closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working implemented for next release This has been implemented in the current dev build for the next public release
Projects
None yet
Development

No branches or pull requests

2 participants