Add GetShort() method in dataTypes

This commit is contained in:
ReinforceZwei 2020-03-27 13:24:52 +08:00 committed by ORelio
parent 311815be9f
commit 137855a71d
4 changed files with 14 additions and 6 deletions

View file

@ -1366,10 +1366,7 @@ namespace MinecraftClient.Protocol.Handlers
try
{
List<byte> packet = new List<byte>();
// short to byte (?
byte[] b = BitConverter.GetBytes(slot);
Array.Reverse(b);
packet.AddRange(b);
packet.AddRange(dataTypes.GetShort(slot));
SendPacket(PacketOutgoingType.HeldItemChange, packet);
return true;
}