mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Inventory drop 1/all + message
This commit is contained in:
parent
9eeb052bb7
commit
5b0b0c9cc3
1 changed files with 6 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ namespace MinecraftClient.Commands
|
||||||
class Inventory : Command
|
class Inventory : Command
|
||||||
{
|
{
|
||||||
public override string CMDName { get { return "inventory"; } }
|
public override string CMDName { get { return "inventory"; } }
|
||||||
public override string CMDDesc { get { return "inventory <<id>|player|container> <list|close|drop <slot> <all>|click <slot> <left|right|middle>>: Interact with inventories"; } }
|
public override string CMDDesc { get { return "inventory <<id>|player|container> <list|close|drop <slot> <1|all>|click <slot> <left|right|middle>>: Interact with inventories"; } }
|
||||||
|
|
||||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||||
{
|
{
|
||||||
|
|
@ -65,7 +65,7 @@ namespace MinecraftClient.Commands
|
||||||
int slot = int.Parse(args[2]);
|
int slot = int.Parse(args[2]);
|
||||||
WindowActionType actionType = WindowActionType.LeftClick;
|
WindowActionType actionType = WindowActionType.LeftClick;
|
||||||
string keyName = "Left";
|
string keyName = "Left";
|
||||||
if (args.Length == 4)
|
if (args.Length >= 4)
|
||||||
{
|
{
|
||||||
string b = args[3];
|
string b = args[3];
|
||||||
if (b.ToLower()[0] == 'r')
|
if (b.ToLower()[0] == 'r')
|
||||||
|
|
@ -91,7 +91,7 @@ namespace MinecraftClient.Commands
|
||||||
if (!handler.GetInventory(inventoryId).Items.ContainsKey(slot))
|
if (!handler.GetInventory(inventoryId).Items.ContainsKey(slot))
|
||||||
return "No item in slot #" + slot;
|
return "No item in slot #" + slot;
|
||||||
WindowActionType actionType = WindowActionType.DropItem;
|
WindowActionType actionType = WindowActionType.DropItem;
|
||||||
if (args.Length == 4)
|
if (args.Length >= 4)
|
||||||
{
|
{
|
||||||
if (args[3].ToLower() == "all")
|
if (args[3].ToLower() == "all")
|
||||||
{
|
{
|
||||||
|
|
@ -100,7 +100,9 @@ namespace MinecraftClient.Commands
|
||||||
}
|
}
|
||||||
if (handler.DoWindowAction(inventoryId, slot, actionType))
|
if (handler.DoWindowAction(inventoryId, slot, actionType))
|
||||||
{
|
{
|
||||||
return "Dropped item from slot #" + slot;
|
if (actionType == WindowActionType.DropItemStack)
|
||||||
|
return "Dropped whole item stack from slot #" + slot;
|
||||||
|
else return "Dropped 1 item from slot #" + slot;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue