mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-23 16:41:20 +01:00
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.
This commit is contained in:
parent
effbd62e68
commit
c633a2d070
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user