Minecraft-Console-Client/MinecraftClient/Commands/UseItem.cs

25 lines
760 B
C#
Raw Normal View History

2020-03-22 20:12:06 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.Commands
{
class UseItem : Command
{
public override string CmdName { get { return "useitem"; } }
public override string CmdUsage { get { return "useitem"; } }
public override string CmdDesc { get { return "cmd.useitem.desc"; } }
2020-03-22 20:12:06 +08:00
public override string Run(McClient handler, string command, Dictionary<string, object> localVars)
2020-03-22 20:12:06 +08:00
{
if (handler.GetInventoryEnabled())
{
handler.UseItemOnHand();
return Translations.Get("cmd.useitem.use");
}
else return Translations.Get("extra.inventory_required");
2020-03-22 20:12:06 +08:00
}
}
}