mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 18:47:44 +01:00
Fix trees not growing naturally in protected regions.
Fixes WORLDGUARD-3166.
This commit is contained in:
parent
73fe9cd62f
commit
1a12faf5ab
@ -211,7 +211,13 @@ public void onBlockBurn(BlockBurnEvent event) {
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onStructureGrowEvent(StructureGrowEvent event) {
|
||||
List<Block> blockList = Lists.transform(event.getBlocks(), new BlockStateAsBlockFunction());
|
||||
Events.fireBulkEventToCancel(event, new PlaceBlockEvent(event, create(event.getPlayer()), event.getLocation().getWorld(), blockList, Material.AIR));
|
||||
|
||||
Player player = event.getPlayer();
|
||||
if (player != null) {
|
||||
Events.fireBulkEventToCancel(event, new PlaceBlockEvent(event, create(player), event.getLocation().getWorld(), blockList, Material.AIR));
|
||||
} else {
|
||||
Events.fireBulkEventToCancel(event, new PlaceBlockEvent(event, create(event.getLocation().getBlock()), event.getLocation().getWorld(), blockList, Material.AIR));
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Handle EntityCreatePortalEvent?
|
||||
|
Loading…
Reference in New Issue
Block a user