mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
ReadNextNBT() now returns an empty dictionary if the NBT tag is 0x00 As per https://wiki.vg/Slot_Data 0x00 being a placeholder for "no NBT"
This commit is contained in:
parent
981bae184a
commit
c19802725f
1 changed files with 4 additions and 2 deletions
|
|
@ -324,16 +324,18 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
/// </summary>
|
||||
private Dictionary<string, object> ReadNextNbt(List<byte> cache, bool root)
|
||||
{
|
||||
Dictionary<string, object> NbtData = new Dictionary<string, object>();
|
||||
|
||||
if (root)
|
||||
{
|
||||
if (cache[0] == 0) // TAG_End
|
||||
return NbtData;
|
||||
if (cache[0] != 10) // TAG_Compound
|
||||
throw new System.IO.InvalidDataException("Failed to decode NBT: Does not start with TAG_Compound");
|
||||
ReadNextByte(cache); // Tag type (TAG_Compound)
|
||||
ReadData(ReadNextUShort(cache), cache); // NBT root name
|
||||
}
|
||||
|
||||
Dictionary<string, object> NbtData = new Dictionary<string, object>();
|
||||
|
||||
while (true)
|
||||
{
|
||||
int fieldType = ReadNextByte(cache);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue