Finish AutoCraft core functional part

This commit is contained in:
ReinforceZwei 2020-07-09 22:21:39 +08:00 committed by ORelio
parent 82fb081828
commit 97d7325939
5 changed files with 220 additions and 52 deletions

View file

@ -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();
}
}
}