diff --git a/MinecraftClient/Protocol/Handlers/DataTypes.cs b/MinecraftClient/Protocol/Handlers/DataTypes.cs index 22e1cc7210..793cb2b3a1 100644 --- a/MinecraftClient/Protocol/Handlers/DataTypes.cs +++ b/MinecraftClient/Protocol/Handlers/DataTypes.cs @@ -645,12 +645,11 @@ private object ReadNbtField(Queue cache, int fieldType) while (key != terminteValue) { - if (protocolversion <= Protocol18Handler.MC_1_8_Version) - key = (byte)(key & 0x1f); - int typeId = protocolversion <= Protocol18Handler.MC_1_8_Version ? key >> 5 // 1.8 : ReadNextVarInt(cache); // 1.9+ + + EntityMetaDataType type; try { @@ -660,6 +659,9 @@ private object ReadNbtField(Queue cache, int fieldType) { throw new System.IO.InvalidDataException("Unknown Metadata Type ID " + typeId + ". Is this up to date for new MC Version?"); } + + if (protocolversion <= Protocol18Handler.MC_1_8_Version) + key = (byte)(key & 0x1f); // Value's data type is depended on Type object? value = null;