mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +01:00
Added Material.isEdible. Thanks simplyianm
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
56b92a4f45
commit
1d06c840a4
1 changed files with 24 additions and 0 deletions
|
@ -387,6 +387,30 @@ public enum Material {
|
|||
return id < 256;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this Material is edible.
|
||||
*
|
||||
* @return true if this Material is edible.
|
||||
*/
|
||||
public boolean isEdible() {
|
||||
return equals(Material.BREAD)
|
||||
|| equals(Material.COOKIE)
|
||||
|| equals(Material.MELON)
|
||||
|| equals(Material.MUSHROOM_SOUP)
|
||||
|| equals(Material.RAW_CHICKEN)
|
||||
|| equals(Material.COOKED_CHICKEN)
|
||||
|| equals(Material.RAW_BEEF)
|
||||
|| equals(Material.COOKED_BEEF)
|
||||
|| equals(Material.RAW_FISH)
|
||||
|| equals(Material.COOKED_FISH)
|
||||
|| equals(Material.PORK)
|
||||
|| equals(Material.GRILLED_PORK)
|
||||
|| equals(Material.APPLE)
|
||||
|| equals(Material.GOLDEN_APPLE)
|
||||
|| equals(Material.ROTTEN_FLESH)
|
||||
|| equals(Material.SPIDER_EYE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to get the Material with the given ID
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue