Only initialize NMSUtil#nmsVersionPackage when required (pre 1.17 servers)
Fixes support with Paper 1.20.5+ since they decided to not relocate CraftBukkit anymore. Closes https://github.com/ViaVersion/ViaRewind-Legacy-Support/issues/78
This commit is contained in:
parent
b95e03512e
commit
560b84e3f5
|
@ -35,7 +35,9 @@ public class NMSUtil {
|
|||
private static Field playerConnectionField;
|
||||
|
||||
static {
|
||||
nmsVersionPackage = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
|
||||
if (BukkitPlugin.getInstance().getServerProtocol().olderThan(ProtocolVersion.v1_17)) {
|
||||
nmsVersionPackage = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
|
||||
}
|
||||
}
|
||||
|
||||
public static Class<?> getBlockPositionClass() {
|
||||
|
|
Loading…
Reference in New Issue