Fix vMANY

This commit is contained in:
TomTom 2024-06-13 21:43:35 +02:00
parent bc2d03adf4
commit 6b312bb35f

View File

@ -80,10 +80,21 @@ class MinionPlaceListener : Listener {
var islandId = "" var islandId = ""
if (islandLimit > 0 && AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration() != null) { if (islandLimit > 0 && AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration() != null) {
islandId = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration()!!.getIslandAt(location) islandId = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration()!!.getIslandAt(location)
if (Config.DEBUG()) {
event.player.sendMessage("Island ID: $islandId, limit: $islandLimit")
}
if (islandId.isNotBlank()) { if (islandId.isNotBlank()) {
islandPlaced = AxMinionsAPI.INSTANCE.getDataHandler().getIsland(islandId) islandPlaced = AxMinionsAPI.INSTANCE.getDataHandler().getIsland(islandId)
if (Config.DEBUG()) {
event.player.sendMessage("Placed: $islandPlaced")
}
if (islandPlaced >= islandLimit && !event.player.hasPermission("axminions.limit.*")) { if (islandPlaced >= islandLimit && !event.player.hasPermission("axminions.limit.*")) {
if (Config.DEBUG()) {
event.player.sendMessage("Return")
}
event.player.sendMessage( event.player.sendMessage(
StringUtils.formatToString( StringUtils.formatToString(
Messages.PREFIX() + Messages.ISLAND_LIMIT_REACHED(), Messages.PREFIX() + Messages.ISLAND_LIMIT_REACHED(),
@ -98,6 +109,10 @@ class MinionPlaceListener : Listener {
item.itemMeta = meta item.itemMeta = meta
} }
return@submit return@submit
} else {
if (Config.DEBUG()) {
event.player.sendMessage("Not return ${islandPlaced >= islandLimit} ${!event.player.hasPermission("axminions.limit.*")}")
}
} }
} }
} }