Add AutoEat

#923
This commit is contained in:
ReinforceZwei 2020-04-08 00:28:03 +08:00 committed by ORelio
parent 70e5ae85d7
commit 2e1e79bcef
10 changed files with 128 additions and 11 deletions

View file

@ -70,5 +70,24 @@ 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;
}
}
}
}