fix: support Paper 26.x unversioned craftbukkit package#290
Conversation
|
Thanks for the PR, but why does it show that the class content was fully removed then added back? Pseudo code: |
|
Thanks for the feedback!
public static Class<?> getCraftClass(@NotNull final String name) throws ClassNotFoundException { I'll push a cleaner commit with this approach. |
Paper 26.x removed the version suffix from the craftbukkit package. Check IS_PAPER first and try without version prefix, then fall back to the versioned package for older/non-Paper servers. Fixes HelpChat#196
bf07260 to
698dd4d
Compare
|
I'm sorry, I'm a beginner in coding and in using GitHub. |
|
Hey, I've double-checked when the change was made, and it turns out Paper changed it back in 1.20.5 while Spigot just did in 26.1. |
|
I think is good now, thanks for your help. |
|
Shouldnt it be 1_26_1 or did they change the versioning to no longer start with 1? |
|
Haven't checked but I'm pretty sure it doesn't start with 1 anymore |
|
And the version checker works fine? |
|
I'm at work now, i check that Tuesday, i dont have computer with Minecraft for try. |
|
There's actually a deeper issue here - the version encoding breaks when major > 9. The condition works only because of the first check (>= 2610). |
|
This needs to be tested: make the minor and patch numbers two digits. The constants will need to be changed to check for 1_20_01 instead of 1_20_1. |
|
The version regex also needs to be updated if we go this way, to capture major, minor and patch individually in order to pad them with 0. |
|
You learn me a lot, thanks you so much . |
|
Looks good, but please use a constant for that condition inside getCraftClass and also please define the numbers as major_minor_patch, e.g. 1_20_05, it is easier to read them like this. |
Paper 26.x removed the version suffix from the craftbukkit package (e.g. org.bukkit.craftbukkit.v1_21_R3 -> org.bukkit.craftbukkit). getCraftClass now tries without suffix first, then falls back to the versioned package for older server versions.