Blocked block placing on minion position

This commit is contained in:
migu-star 2024-02-27 22:30:31 +01:00
parent bb49732467
commit 1d2b9937a2

View File

@ -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
}
}
}