mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Code refactoring (related to #1024)
This commit is contained in:
parent
d120001d70
commit
23870711a0
11 changed files with 69 additions and 100 deletions
|
|
@ -215,8 +215,6 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
break;
|
||||
case PacketIncomingType.JoinGame:
|
||||
handler.OnGameJoined();
|
||||
// by reinforce
|
||||
// get client player EntityID
|
||||
int playerEntityID = dataTypes.ReadNextInt(packetData);
|
||||
handler.SetPlayerEntityID(playerEntityID);
|
||||
dataTypes.ReadNextByte(packetData);
|
||||
|
|
@ -1377,13 +1375,13 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
catch (ObjectDisposedException) { return false; }
|
||||
}
|
||||
|
||||
public bool SendCreativeInventoryAction(int slot, Item item)
|
||||
public bool SendCreativeInventoryAction(int slot, ItemType itemType, int count)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<byte> packet = new List<byte>();
|
||||
packet.AddRange(dataTypes.GetShort((short)slot));
|
||||
packet.AddRange(dataTypes.GetItemSlot(item));
|
||||
packet.AddRange(dataTypes.GetItemSlot(new Item((int)itemType, count, null)));
|
||||
|
||||
SendPacket(PacketOutgoingType.CreativeInventoryAction, packet);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue