Skip to content
Permalink
Browse files

Cover some more plants as crop-growth.

Note that spigot doesn't throw events for bamboo yet, so this only
applies to sugar canes and cacti at the moment. Should work if spigot
implements BlockGrowEvent for cacti though.

Fixes WORLDGUARD-4137.
  • Loading branch information...
wizjany committed Sep 13, 2019
1 parent effbd62 commit c633a2d0700f9abf415b7d213d0e0c79daf6b613
@@ -620,7 +620,7 @@ public void onBlockSpread(BlockSpreadEvent event) {
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockGrow(BlockGrowEvent event) {
WorldConfiguration wcfg = getWorldConfig(event.getBlock().getWorld());
final Material type = event.getBlock().getType();
final Material type = event.getNewState().getType();

if (Materials.isCrop(type)) {
if (wcfg.disableCropGrowth) {
@@ -1198,7 +1198,11 @@ public static boolean isCrop(Material type) {
|| type == Material.MELON_STEM
|| type == Material.PUMPKIN_STEM
|| type == Material.PUMPKIN
|| type == Material.MELON;
|| type == Material.MELON
|| type == Material.CACTUS
|| type == Material.SUGAR_CANE
|| type == Material.BAMBOO
|| type == Material.BAMBOO_SAPLING;
}

/**

0 comments on commit c633a2d

Please sign in to comment.
You can’t perform that action at this time.