diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java b/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java index bb3fed3c..9261f7bb 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java @@ -852,9 +852,15 @@ public class MinecraftReflection { returnTypeMatches(tagCompoundContract). build() ); + Class nbtBase = selected.getReturnType().getSuperclass(); + // That can't be correct + if (nbtBase == null || nbtBase.equals(Object.class)) { + throw new IllegalStateException("Unable to find NBT base class: " + nbtBase); + } + // Use the return type here too - return setMinecraftClass("NBTBase", selected.getReturnType()); + return setMinecraftClass("NBTBase", nbtBase); } }