diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-06 09:44:16 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-12-06 09:44:16 +0000 |
commit | 901832e0410a5e0526ded131d139e883f4942c33 (patch) | |
tree | 456f5691f4543860dd83be26cd8c5eb077aa2133 /src/main/java/org | |
parent | d2a7e4701b4efed34df4660daa8458aabbee332c (diff) | |
download | bukkit-901832e0410a5e0526ded131d139e883f4942c33.tar bukkit-901832e0410a5e0526ded131d139e883f4942c33.tar.gz bukkit-901832e0410a5e0526ded131d139e883f4942c33.tar.lz bukkit-901832e0410a5e0526ded131d139e883f4942c33.tar.xz bukkit-901832e0410a5e0526ded131d139e883f4942c33.zip |
Added Material.isEdible. Thanks simplyianm
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/Material.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 48731421..450c23bc 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -388,6 +388,30 @@ public enum Material { } /** + * 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 * * @param id ID of the material to get |