mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add /inventory creativedelete (#1590)
This commit is contained in:
parent
95d6318350
commit
64123a26a5
2 changed files with 31 additions and 14 deletions
|
|
@ -45,6 +45,21 @@ namespace MinecraftClient.Commands
|
||||||
}
|
}
|
||||||
else return GetCmdDescTranslated();
|
else return GetCmdDescTranslated();
|
||||||
}
|
}
|
||||||
|
else if (args[0].ToLower() == "creativedelete")
|
||||||
|
{
|
||||||
|
if (args.Length >= 2)
|
||||||
|
{
|
||||||
|
int slot = int.Parse(args[1]);
|
||||||
|
if (handler.GetGamemode() == 1)
|
||||||
|
{
|
||||||
|
if (handler.DoCreativeGive(slot, ItemType.Null, 0, null))
|
||||||
|
return Translations.Get("cmd.inventory.creative_delete", slot);
|
||||||
|
else return Translations.Get("cmd.inventory.creative_fail");
|
||||||
|
}
|
||||||
|
else return Translations.Get("cmd.inventory.need_creative");
|
||||||
|
}
|
||||||
|
else return GetCmdDescTranslated();
|
||||||
|
}
|
||||||
else if (args[0].ToLower().StartsWith("p"))
|
else if (args[0].ToLower().StartsWith("p"))
|
||||||
{
|
{
|
||||||
// player inventory is always ID 0
|
// player inventory is always ID 0
|
||||||
|
|
@ -177,7 +192,7 @@ namespace MinecraftClient.Commands
|
||||||
|
|
||||||
private string GetAvailableActions()
|
private string GetAvailableActions()
|
||||||
{
|
{
|
||||||
return Translations.Get("cmd.inventory.help.available") + ": list, close, click, drop.";
|
return Translations.Get("cmd.inventory.help.available") + ": list, close, click, drop, creativegive, creativedelete.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetBasicUsage()
|
private string GetBasicUsage()
|
||||||
|
|
@ -187,12 +202,7 @@ namespace MinecraftClient.Commands
|
||||||
|
|
||||||
private string GetHelp()
|
private string GetHelp()
|
||||||
{
|
{
|
||||||
return Translations.Get("cmd.inventory.help.help", GetAvailableActions(), GetCreativeGiveHelp());
|
return Translations.Get("cmd.inventory.help.help", GetAvailableActions());
|
||||||
}
|
|
||||||
|
|
||||||
private string GetCreativeGiveHelp()
|
|
||||||
{
|
|
||||||
return Translations.Get("cmd.inventory.help.usage") + ": /inventory creativegive <slot> <itemtype> <count>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetSubCommandHelp(string cmd)
|
private string GetSubCommandHelp(string cmd)
|
||||||
|
|
@ -200,13 +210,17 @@ namespace MinecraftClient.Commands
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case "list":
|
case "list":
|
||||||
return Translations.Get("cmd.inventory.help.list") + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> list";
|
return Translations.Get("cmd.inventory.help.list") + ' ' + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> list";
|
||||||
case "close":
|
case "close":
|
||||||
return Translations.Get("cmd.inventory.help.close") + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> close";
|
return Translations.Get("cmd.inventory.help.close") + ' ' + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> close";
|
||||||
case "click":
|
case "click":
|
||||||
return Translations.Get("cmd.inventory.help.click") + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> click <slot> [left|right|middle]. \nDefault is left click";
|
return Translations.Get("cmd.inventory.help.click") + ' ' + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> click <slot> [left|right|middle]. \nDefault is left click";
|
||||||
case "drop":
|
case "drop":
|
||||||
return Translations.Get("cmd.inventory.help.drop") + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> drop <slot> [all]. \nAll means drop full stack";
|
return Translations.Get("cmd.inventory.help.drop") + ' ' + Translations.Get("cmd.inventory.help.usage") + ": /inventory <player|container|<id>> drop <slot> [all]. \nAll means drop full stack";
|
||||||
|
case "creativegive":
|
||||||
|
return Translations.Get("cmd.inventory.help.creativegive") + ' ' + Translations.Get("cmd.inventory.help.usage") + ": /inventory creativegive <slot> <itemtype> <amount>";
|
||||||
|
case "creativedelete":
|
||||||
|
return Translations.Get("cmd.inventory.help.creativedelete") + ' ' + Translations.Get("cmd.inventory.help.usage") + ": /inventory creativedelete <slot>";
|
||||||
case "help":
|
case "help":
|
||||||
return GetHelp();
|
return GetHelp();
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -254,8 +254,9 @@ cmd.health.response=Health: {0}, Saturation: {1}, Level: {2}, TotalExperience: {
|
||||||
# Inventory
|
# Inventory
|
||||||
cmd.inventory.desc=Inventory command
|
cmd.inventory.desc=Inventory command
|
||||||
cmd.inventory.creative_done=Requested {0} x{1} in slot #{2}
|
cmd.inventory.creative_done=Requested {0} x{1} in slot #{2}
|
||||||
cmd.inventory.creative_fail=Failed to request Creative Give
|
cmd.inventory.creative_delete=Requested to clear slot #{0}
|
||||||
cmd.inventory.need_creative=You need Gamemode Creative
|
cmd.inventory.creative_fail=Failed to request Creative action
|
||||||
|
cmd.inventory.need_creative=You must be in Creative gamemode
|
||||||
cmd.inventory.container_not_found=Cannot find container, please retry with explicit ID
|
cmd.inventory.container_not_found=Cannot find container, please retry with explicit ID
|
||||||
cmd.inventory.close=Closing Inventoy #{0}
|
cmd.inventory.close=Closing Inventoy #{0}
|
||||||
cmd.inventory.close_fail=Failed to close Inventory #{0}
|
cmd.inventory.close_fail=Failed to close Inventory #{0}
|
||||||
|
|
@ -274,12 +275,14 @@ cmd.inventory.drop_stack=Dropped whole item stack from slot #{0}
|
||||||
# Inventory Help
|
# Inventory Help
|
||||||
cmd.inventory.help.basic=Basic usage
|
cmd.inventory.help.basic=Basic usage
|
||||||
cmd.inventory.help.available=Available actions
|
cmd.inventory.help.available=Available actions
|
||||||
cmd.inventory.help.help=\n{0} Use '/inventory help <action>' for action help.\nCreative mode give: {1}\n'player' and 'container' can be simplified to 'p' and 'c'.\nNote that parameters in '[]' are optional.
|
cmd.inventory.help.help={0}\nUse '/inventory help <action>' for action help.\n'player' and 'container' can be simplified to 'p' and 'c'.\nNote that parameters in '[]' are optional.
|
||||||
cmd.inventory.help.usage=Usage
|
cmd.inventory.help.usage=Usage
|
||||||
cmd.inventory.help.list=List your inventory.
|
cmd.inventory.help.list=List your inventory.
|
||||||
cmd.inventory.help.close=Close an opened container.
|
cmd.inventory.help.close=Close an opened container.
|
||||||
cmd.inventory.help.click=Click on an item.
|
cmd.inventory.help.click=Click on an item.
|
||||||
cmd.inventory.help.drop=Drop an item from inventory.
|
cmd.inventory.help.drop=Drop an item from inventory.
|
||||||
|
cmd.inventory.help.creativegive=Give item in creative mode.
|
||||||
|
cmd.inventory.help.creativedelete=Clear slot in creative mode.
|
||||||
cmd.inventory.help.unknown=Unknown action.
|
cmd.inventory.help.unknown=Unknown action.
|
||||||
|
|
||||||
# List
|
# List
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue