mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Inventory: Select foreground container (#1875)
When several containers are open "/inventory container" will select the container with highest ID (i.e. foreground container)
This commit is contained in:
parent
25248025c2
commit
259ef80cf9
1 changed files with 2 additions and 2 deletions
|
|
@ -69,8 +69,8 @@ namespace MinecraftClient.Commands
|
||||||
{
|
{
|
||||||
List<int> availableIds = handler.GetInventories().Keys.ToList();
|
List<int> availableIds = handler.GetInventories().Keys.ToList();
|
||||||
availableIds.Remove(0); // remove player inventory ID from list
|
availableIds.Remove(0); // remove player inventory ID from list
|
||||||
if (availableIds.Count == 1)
|
if (availableIds.Count > 0)
|
||||||
inventoryId = availableIds[0]; // one container, use it
|
inventoryId = availableIds.Max(); // use foreground container
|
||||||
else return Translations.Get("cmd.inventory.container_not_found");
|
else return Translations.Get("cmd.inventory.container_not_found");
|
||||||
}
|
}
|
||||||
else if (args[0].ToLower() == "help")
|
else if (args[0].ToLower() == "help")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue