mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Fix issue where Tree Feller wouldn't work on the base of a
player-planted tree. Fixes #524
This commit is contained in:
parent
51777dbe85
commit
734d691e00
@ -2,11 +2,16 @@ package com.gmail.nossr50.listeners;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.TreeType;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
import org.bukkit.event.world.WorldInitEvent;
|
||||
import org.bukkit.event.world.WorldUnloadEvent;
|
||||
|
||||
@ -16,6 +21,21 @@ import com.gmail.nossr50.runnables.blockstoreconversion.BlockStoreConversionMain
|
||||
public class WorldListener implements Listener {
|
||||
ArrayList<BlockStoreConversionMain> converters = new ArrayList<BlockStoreConversionMain>();
|
||||
|
||||
@EventHandler (priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onStructureGrow(StructureGrowEvent event) {
|
||||
TreeType species = event.getSpecies();
|
||||
|
||||
if (species == TreeType.BROWN_MUSHROOM || species == TreeType.RED_MUSHROOM) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<BlockState> blocks = event.getBlocks();
|
||||
|
||||
for (BlockState block : blocks) {
|
||||
mcMMO.placeStore.setFalse(block.getBlock());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWorldInit(WorldInitEvent event) {
|
||||
File dataDir = new File(event.getWorld().getWorldFolder(), "mcmmo_data");
|
||||
|
Loading…
Reference in New Issue
Block a user