mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add Entity.Name & /inventory 0 creative <slot> <itemtype> <count> (#1024)
* Update Program.cs * Update Entity.cs Add Entity.Name * Update Program.cs * Update Entity.cs Add break; * Update Entity.cs * Update Inventory.cs Add /inventory 0 creative <slot> <item> <count> * Update PacketOutgoingType.cs + CreativeInventoryAction * Update Protocol16.cs + SendCreativeInventorAction * Update Protocol18.cs + SendCreativeInventorAction * Update IMinecraftCom.cs + SendCreativeInventorAction * Update McTcpClient.cs + DoCreativeInventorAction * Update ChatBot.cs + CreativeInventorAction * Update McTcpClient.cs * Update ChatBot.cs * Update Inventory.cs Add show count * Update ChatBot.cs + ChatBot fix * Update Inventory.cs Inventory update and Fix * Update Entity.cs * Update McTcpClient.cs * Update Program.cs * Update Protocol16.cs * Update Protocol18.cs * Update IMinecraftCom.cs * Update Entity.cs
This commit is contained in:
parent
65620e2e95
commit
d120001d70
8 changed files with 110 additions and 16 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
|
@ -9,7 +9,7 @@ namespace MinecraftClient.Commands
|
|||
class Inventory : Command
|
||||
{
|
||||
public override string CMDName { get { return "inventory"; } }
|
||||
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 CMDDesc { get { return "inventory <<id>|player|container> <list|close|drop <slot> <1|all>|click <slot> <left|right|middle>|creativegive <slot> <itemtype> <count>>: Interact with inventories"; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
|
|
@ -110,6 +110,32 @@ namespace MinecraftClient.Commands
|
|||
}
|
||||
}
|
||||
else return CMDDesc;
|
||||
case "creativegive":
|
||||
if (args.Length >= 3)
|
||||
{
|
||||
int slot = int.Parse(args[2]);
|
||||
ItemType ItemType = ItemType.Stone;
|
||||
if (Enum.TryParse(args[3], out ItemType))
|
||||
{
|
||||
int count = int.Parse(args[4]);
|
||||
Dictionary<string, object> NBT = null;
|
||||
Item item = new Item((int)ItemType, count, NBT);
|
||||
|
||||
if (handler.DoCreativeInventoryAction(slot, item))
|
||||
{
|
||||
return "You have received " + ItemType + " x" + count + " in the slot #" + slot;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Failed";
|
||||
}
|
||||
}
|
||||
else;
|
||||
{
|
||||
return CMDDesc;
|
||||
}
|
||||
}
|
||||
else return CMDDesc;
|
||||
default:
|
||||
return CMDDesc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue