mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +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
|
|
@ -693,7 +693,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
return false; //Currently not implemented
|
||||
}
|
||||
|
||||
public bool SendCreativeInventoryAction(int slot, Item item)
|
||||
public bool SendCreativeInventoryAction(int slot, ItemType item, int count)
|
||||
{
|
||||
return false; //Currently not implemented
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -150,11 +150,14 @@ namespace MinecraftClient.Protocol
|
|||
bool SendWindowAction(int windowId, int slotId, WindowActionType action, Item item);
|
||||
|
||||
/// <summary>
|
||||
/// Send a click window slot packet to the server
|
||||
/// Request Creative Mode item creation into regular/survival Player Inventory
|
||||
/// </summary>
|
||||
/// <param name="slot">Id of inventory slot</param>
|
||||
/// <param name="item">Id of item </param>
|
||||
bool SendCreativeInventoryAction(int slot, Item item);
|
||||
/// <remarks>(obviously) requires to be in creative mode</remarks>
|
||||
/// <param name="slot">Destination inventory slot</param>
|
||||
/// <param name="itemType">Item type</param>
|
||||
/// <param name="count">Item count</param>
|
||||
/// <returns>TRUE if item given successfully</returns>
|
||||
bool SendCreativeInventoryAction(int slot, ItemType itemType, int count);
|
||||
|
||||
/// <summary>
|
||||
/// Send a close window packet to the server
|
||||
|
|
|
|||
|
|
@ -137,13 +137,13 @@ namespace MinecraftClient.Protocol
|
|||
void OnSpawnEntity(Entity entity);
|
||||
|
||||
/// <summary>
|
||||
/// Called when a player has spawned
|
||||
/// Called when a player spawns or enters the client's render distance
|
||||
/// </summary>
|
||||
/// <param name="EntityID">Entity ID</param>
|
||||
/// <param name="UUID">Entity UUID</param>
|
||||
/// <param name="entityID">Entity ID</param>
|
||||
/// <param name="uuid">Entity UUID</param>
|
||||
/// <param name="location">Entity location</param>
|
||||
/// <param name="Yaw">Player head yaw</param>
|
||||
/// <param name="Pitch">Player head pitch</param>
|
||||
/// <param name="yaw">Player head yaw</param>
|
||||
/// <param name="pitch">Player head pitch</param>
|
||||
void OnSpawnPlayer(int entityID, Guid uuid, Location location, byte yaw, byte pitch);
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -160,7 +160,7 @@ namespace MinecraftClient.Protocol
|
|||
/// <param name="Dy">Y offset</param>
|
||||
/// <param name="Dz">Z offset</param>
|
||||
/// <param name="onGround">TRUE if on ground</param>
|
||||
void OnEntityPosition(int entityID, Double dx, Double dy, Double dz,bool onGround);
|
||||
void OnEntityPosition(int entityID, Double dx, Double dy, Double dz, bool onGround);
|
||||
|
||||
/// <summary>
|
||||
/// Called when an entity moved to fixed coordinates
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue