Remove VarIntArray because I cannot read wiki's correctly xD

This commit is contained in:
Bas950 2020-06-29 16:16:22 +02:00
parent 424eab29dd
commit 627ad5aaf1
2 changed files with 2 additions and 23 deletions

View file

@ -284,27 +284,6 @@ namespace MinecraftClient.Protocol.Handlers
return i; return i;
} }
/// <summary>
/// Read an integer from a cache of bytes and remove it from the cache
/// </summary>
/// <param name="cache">Cache of bytes to read from</param>
/// <returns>The integer</returns>
public int[] ReadNextVarIntArray(Queue<byte> cache)
{
string rawData = BitConverter.ToString(cache);
int i = 0;
int j = 0;
int k = 0;
while (true)
{
k = ReadNextByte(cache);
i |= (k & 0x7F) << j++ * 7;
if (j > 5) throw new OverflowException("VarInt too big " + rawData);
if ((k & 0x80) != 128) break;
}
return i;
}
/// <summary> /// <summary>
/// Read an "extended short", which is actually an int of some kind, from the cache of bytes. /// Read an "extended short", which is actually an int of some kind, from the cache of bytes.
/// This is only done with forge. It looks like it's a normal short, except that if the high /// This is only done with forge. It looks like it's a normal short, except that if the high

View file

@ -225,7 +225,7 @@ namespace MinecraftClient.Protocol.Handlers
if (protocolversion >= MC116Version) if (protocolversion >= MC116Version)
dataTypes.ReadNextVarInt(packetData); // World Count - 1.16 and above dataTypes.ReadNextVarInt(packetData); // World Count - 1.16 and above
if (protocolversion >= MC116Version) if (protocolversion >= MC116Version)
dataTypes.ReadNextVarIntArray(packetData); // World Names - 1.16 and above dataTypes.ReadNextString(packetData); // World Names - 1.16 and above
if (protocolversion >= MC116Version) if (protocolversion >= MC116Version)
dataTypes.ReadNextNbt(packetData); // Dimension Codec - 1.16 and above dataTypes.ReadNextNbt(packetData); // Dimension Codec - 1.16 and above
if (protocolversion >= MC191Version) if (protocolversion >= MC191Version)