2022-10-02 18:31:08 +08:00
|
|
|
|
using System.Collections.Generic;
|
2022-10-26 08:54:54 +08:00
|
|
|
|
using Brigadier.NET;
|
2020-03-22 20:12:06 +08:00
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Commands
|
|
|
|
|
|
{
|
|
|
|
|
|
class UseItem : Command
|
|
|
|
|
|
{
|
2020-10-17 19:41:31 +08:00
|
|
|
|
public override string CmdName { get { return "useitem"; } }
|
|
|
|
|
|
public override string CmdUsage { get { return "useitem"; } }
|
2022-10-28 11:13:20 +08:00
|
|
|
|
public override string CmdDesc { get { return Translations.cmd_useitem_desc; } }
|
2020-03-22 20:12:06 +08:00
|
|
|
|
|
2022-10-26 08:54:54 +08:00
|
|
|
|
public override void RegisterCommand(McClient handler, CommandDispatcher<CommandSource> dispatcher)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-02 18:31:08 +08:00
|
|
|
|
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
|
2020-03-22 20:12:06 +08:00
|
|
|
|
{
|
2020-03-29 18:41:26 +02:00
|
|
|
|
if (handler.GetInventoryEnabled())
|
|
|
|
|
|
{
|
|
|
|
|
|
handler.UseItemOnHand();
|
2022-10-28 11:13:20 +08:00
|
|
|
|
return Translations.cmd_useitem_use;
|
2020-03-29 18:41:26 +02:00
|
|
|
|
}
|
2022-10-28 11:13:20 +08:00
|
|
|
|
else return Translations.extra_inventory_required;
|
2020-03-22 20:12:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|