mirror of
https://github.com/Artillex-Studios/AxMinions.git
synced 2025-01-07 18:58:23 +01:00
Blocked block placing on minion position
This commit is contained in:
parent
bb49732467
commit
1d2b9937a2
@ -19,6 +19,7 @@ import org.bukkit.event.block.Action
|
||||
import org.bukkit.event.player.PlayerInteractEvent
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.persistence.PersistentDataType
|
||||
import org.bukkit.event.block.BlockPlaceEvent
|
||||
|
||||
class MinionPlaceListener : Listener {
|
||||
|
||||
@ -125,4 +126,11 @@ class MinionPlaceListener : Listener {
|
||||
)
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
fun onBlockPlace(event: BlockPlaceEvent) {
|
||||
val blockLocation = event.block.location
|
||||
if (AxMinionsPlugin.dataHandler.isMinion(blockLocation)) {
|
||||
event.isCancelled = true
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user