mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Finish AutoCraft core functional part
This commit is contained in:
parent
82fb081828
commit
97d7325939
5 changed files with 220 additions and 52 deletions
|
|
@ -153,5 +153,24 @@ namespace MinecraftClient.Inventory
|
|||
default: return ContainerType.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search an item in the container
|
||||
/// </summary>
|
||||
/// <param name="itemType">The item to search</param>
|
||||
/// <returns>An array of slot ID</returns>
|
||||
public int[] SearchItem(ItemType itemType)
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
if (Items != null)
|
||||
{
|
||||
foreach (var item in Items)
|
||||
{
|
||||
if (item.Value.Type == itemType)
|
||||
result.Add(item.Key);
|
||||
}
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue