Closed wouterdedroog closed 2 years ago
Sure go ahead.
I think replacing getMajorVersion and all the substring stuff with a simple Regex would be more reliable and maintainable at this point. This is really just parsed statically, so performance doesn't matter at all. You should also avoid caching the compiled regex and remove getMajorVersion altogether because Idk why anyone would want to use them.
It's really sad that there's no standardized way of getting version details with the Spigot API.
Hi, I've already started working on getting my plugin ready to support 1.18, and I've used the the SpigotMC build for Pre-release 5 to test my changes. Whilst testing, I ran into a small issue with the version parsing that prevented my plugin from working as expected. I've worked around this issue by temporarily hardcoding the value of the
Data.VERSION
to 18.I got the following error:
I'm relocating the XSeries dependency to prevent conflicts, which is why the package names might look off. This is by no means a high-priority issue, since it only affects pre-release versions that probably aren't supported anyway. For me it wasn't a concern, since I could simply hardcode the value
This issue is caused by the following line, and could probably be prevented by replacing the
.substring(2)
with a variation of.substring(2, 4)
, since this will cause issues with versions <= 1.9. If wanted, I can quickly create a PR for this.https://github.com/CryptoMorin/XSeries/blob/4f7dfe56d640d6c297c3cd8347b936f33ab29c37/src/main/java/com/cryptomorin/xseries/XMaterial.java#L2154
Thanks for the amazing work you do! <3