mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
start implement
This commit is contained in:
parent
d6022d1ee9
commit
902527502e
4 changed files with 17 additions and 1 deletions
|
|
@ -83,6 +83,13 @@ namespace MinecraftClient.Commands
|
||||||
return keyName + " clicking slot " + slot + " in window #" + inventoryId;
|
return keyName + " clicking slot " + slot + " in window #" + inventoryId;
|
||||||
}
|
}
|
||||||
else return CMDDesc;
|
else return CMDDesc;
|
||||||
|
case "drop":
|
||||||
|
if (args.Length >= 3)
|
||||||
|
{
|
||||||
|
int slot = int.Parse(args[2]);
|
||||||
|
handler.DoWindowAction(inventoryId, slot, WindowActionType.DropItem);
|
||||||
|
}
|
||||||
|
return "Dropped";
|
||||||
default:
|
default:
|
||||||
return CMDDesc;
|
return CMDDesc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ namespace MinecraftClient.Inventory
|
||||||
{
|
{
|
||||||
LeftClick,
|
LeftClick,
|
||||||
RightClick,
|
RightClick,
|
||||||
MiddleClick
|
MiddleClick,
|
||||||
|
DropItem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1362,6 +1362,13 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
case WindowActionType.LeftClick: button = 0; break;
|
case WindowActionType.LeftClick: button = 0; break;
|
||||||
case WindowActionType.RightClick: button = 1; break;
|
case WindowActionType.RightClick: button = 1; break;
|
||||||
case WindowActionType.MiddleClick: button = 2; mode = 3; break;
|
case WindowActionType.MiddleClick: button = 2; mode = 3; break;
|
||||||
|
case WindowActionType.DropItem:
|
||||||
|
button = 0;
|
||||||
|
mode = 4;
|
||||||
|
item = new Item(-1, 0, null);
|
||||||
|
Container inventory = handler.GetInventory(0);
|
||||||
|
inventory.Items[slotId].Count--; // server won't update us after dropped
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<byte> packet = new List<byte>();
|
List<byte> packet = new List<byte>();
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ namespace MinecraftClient.Protocol
|
||||||
bool SetInventoryEnabled(bool enabled);
|
bool SetInventoryEnabled(bool enabled);
|
||||||
bool GetEntityHandlingEnabled();
|
bool GetEntityHandlingEnabled();
|
||||||
bool SetEntityHandlingEnabled(bool enabled);
|
bool SetEntityHandlingEnabled(bool enabled);
|
||||||
|
Container GetInventory(int inventoryID);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a server was successfully joined
|
/// Called when a server was successfully joined
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue