mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Implement inventory right click
This commit is contained in:
parent
5da55a2f9a
commit
4f96aa2081
5 changed files with 16 additions and 8 deletions
|
|
@ -688,7 +688,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
return false; //Currently not implemented
|
||||
}
|
||||
|
||||
public bool SendClickWindow(int windowId, int slotId, Item item)
|
||||
public bool SendClickWindow(int windowId, int slotId, byte buttom, Item item)
|
||||
{
|
||||
return false; //Currently not implemented
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1342,7 +1342,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
catch (ObjectDisposedException) { return false; }
|
||||
}
|
||||
|
||||
public bool SendClickWindow(int windowId, int slotId, Item item)
|
||||
public bool SendClickWindow(int windowId, int slotId, byte buttom, Item item)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -1358,7 +1358,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
List<byte> packet = new List<byte>();
|
||||
packet.Add((byte)windowId);
|
||||
packet.AddRange(dataTypes.GetShort((short)slotId));
|
||||
packet.Add(0); // Left mouse click
|
||||
packet.Add(buttom);
|
||||
packet.AddRange(dataTypes.GetShort(actionNumber));
|
||||
|
||||
// Operation mode = 0 (default)
|
||||
|
|
|
|||
|
|
@ -144,9 +144,10 @@ namespace MinecraftClient.Protocol
|
|||
/// </summary>
|
||||
/// <param name="windowId">Id of the window being clicked</param>
|
||||
/// <param name="slotId">Id of the clicked slot</param>
|
||||
/// <param name="buttom">0 for left click, 1 for right click</param>
|
||||
/// <param name="item">Item in the clicked slot</param>
|
||||
/// <returns>True if packet was successfully sent</returns>
|
||||
bool SendClickWindow(int windowId, int slotId, Item item);
|
||||
bool SendClickWindow(int windowId, int slotId, byte buttom, Item item);
|
||||
|
||||
/// <summary>
|
||||
/// Send a close window packet to the server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue