2022-10-02 18:31:08 +08:00
|
|
|
|
using System.Collections.Generic;
|
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"; } }
|
|
|
|
|
|
public override string CmdDesc { get { return "cmd.useitem.desc"; } }
|
2020-03-22 20:12:06 +08:00
|
|
|
|
|
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();
|
2020-10-17 19:41:31 +08:00
|
|
|
|
return Translations.Get("cmd.useitem.use");
|
2020-03-29 18:41:26 +02:00
|
|
|
|
}
|
2020-10-17 19:41:31 +08:00
|
|
|
|
else return Translations.Get("extra.inventory_required");
|
2020-03-22 20:12:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|