Compare commits

...

2 Commits

Author SHA1 Message Date
FlorianMichael 8a92b4d1df
Fix bounding box fixes on Paper 1.20.5+ 2024-05-02 23:45:24 +02:00
FlorianMichael 560b84e3f5
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
2024-05-02 23:35:28 +02:00
2 changed files with 5 additions and 3 deletions

View File

@ -18,7 +18,6 @@
package com.viaversion.viarewind.legacysupport.feature;
import com.viaversion.viarewind.legacysupport.BukkitPlugin;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import java.lang.reflect.Field;
@ -82,7 +81,8 @@ public class BlockCollisionChanges {
case "AxisAlignedBB": // Legacy NMS
setAxisAlignedBB(boundingBox, values);
break;
case "VoxelShapeArray": // Paper
case "VoxelShapeArray": // Paper 1.20.4-
case "ArrayVoxelShape": // Paper 1.20.5+
setVoxelShapeArray(boundingBox, values);
break;
case "AABBVoxelShape": // Tuinity

View File

@ -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() {