Skip to content

Commit f47508a

Browse files
committed
Add method to check for harvesting of crops.
1 parent 33ec4c8 commit f47508a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/me/staartvin/statz/util/StatzUtil.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,15 @@ public static org.bukkit.Material findMaterial(int typeId, int dataValue) {
649649
return null;
650650
}
651651

652+
public static boolean isHarvestableCrop(Material material) {
653+
654+
List<Material> crops = Arrays.asList(WHEAT, BEETROOTS, CARROTS, POTATOES, MELON, PUMPKIN, BAMBOO, COCOA,
655+
SUGAR_CANE, CACTUS, BROWN_MUSHROOM, RED_MUSHROOM, KELP_PLANT,
656+
SEA_PICKLE, NETHER_WART, CHORUS_PLANT, CHORUS_FLOWER);
657+
658+
return crops.contains(material);
659+
}
660+
652661
public enum Time {
653662
DAYS, HOURS, MINUTES, SECONDS
654663
}

0 commit comments

Comments
 (0)