mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Implement middle click
This commit is contained in:
parent
02d393fe4d
commit
1e5b9fc94b
3 changed files with 17 additions and 5 deletions
|
|
@ -1362,9 +1362,12 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
packet.AddRange(dataTypes.GetShort(actionNumber));
|
||||
|
||||
// Operation mode = 0 (default)
|
||||
byte mode = 0;
|
||||
if (buttom == 2) // middle-click mode is 3
|
||||
mode = 3;
|
||||
if (protocolversion >= MC19Version)
|
||||
packet.AddRange(dataTypes.GetVarInt(0));
|
||||
else packet.Add(0);
|
||||
packet.AddRange(dataTypes.GetVarInt(mode));
|
||||
else packet.Add(mode);
|
||||
|
||||
packet.AddRange(dataTypes.GetItemSlot(item));
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ 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="buttom">0 for left click, 1 for right click, 2 for middle 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, byte buttom, Item item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue