NMSVersion now has a string for the version name (I.e. 1.20).
NMSHandler#initialize now uses Bukkit#getBukkitVersion instead of getting it from the package name, and compares it against NMSVersion's version name strings.
Replaced deprecated Class#newInstance usage with Class#getDeclaredConstructor#newInstance.
[!NOTE]
Could parse the version string directly into the NMSVersion, but that'd be a bit messy with handling patch/release versions and all - let me know if that'd be preferred though.
[!NOTE]
There's technically more "correct" API to use for this (Bukkit#getMinecraftVersion), but that's Paper only and probably not worth the mess? (as the Paper module is obviously not initialized at that point)
Changes
NMSVersion
now has a string for the version name (I.e.1.20
).NMSHandler#initialize
now usesBukkit#getBukkitVersion
instead of getting it from the package name, and compares it againstNMSVersion
's version name strings.Class#newInstance
usage withClass#getDeclaredConstructor#newInstance
.