mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Remove IsFood method from Item class
This commit is contained in:
parent
b1121e91e3
commit
3f9b084a45
3 changed files with 3 additions and 27 deletions
|
|
@ -70,24 +70,5 @@ namespace MinecraftClient.Inventory
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check item is a food
|
||||
/// </summary>
|
||||
/// <returns>True if is a food</returns>
|
||||
public bool IsFood()
|
||||
{
|
||||
// non-poison and stackable food
|
||||
// remarks: auto eat may works with non-stackable food <- not tested
|
||||
int[] foods = { 524, 765, 821, 823, 562, 763, 680, 629, 801, 585, 788, 630, 670, 674, 588, 587, 768, 673, 764, 777, 677, 679, 625, 800, 584, 787, 626, 678, 876, 627 };
|
||||
if (foods.Contains((int)Type))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,7 @@ namespace MinecraftClient.Inventory
|
|||
{
|
||||
public static class ItemTypeExtensions
|
||||
{
|
||||
/**
|
||||
* I see "this" in the MaterialExtensions class method, why need that?
|
||||
* public static bool IsSolid(this Material m)
|
||||
* ^^^^
|
||||
*/
|
||||
public static bool IsFood(ItemType m)
|
||||
public static bool IsFood(this ItemType m)
|
||||
{
|
||||
ItemType[] t =
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue