Added tree growth to PlayerBlockListener.kt
This commit is contained in:
@@ -12,6 +12,7 @@ import org.bukkit.event.block.BlockMultiPlaceEvent
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent
|
||||
import org.bukkit.event.block.BlockPlaceEvent
|
||||
import org.bukkit.event.world.StructureGrowEvent
|
||||
import org.bukkit.persistence.PersistentDataType
|
||||
|
||||
class PlayerBlockListener(
|
||||
@@ -40,6 +41,15 @@ class PlayerBlockListener(
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
fun onGrow(event: StructureGrowEvent) {
|
||||
val block = event.location.block
|
||||
|
||||
this.plugin.scheduler.run {
|
||||
removeKey(block)
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
fun onExtend(event: BlockPistonExtendEvent) {
|
||||
val locs = mutableListOf<Location>()
|
||||
|
||||
Reference in New Issue
Block a user