mirror of
https://github.com/Artillex-Studios/AxMinions.git
synced 2024-11-28 12:35:38 +01:00
Fox
This commit is contained in:
parent
d28f4b9880
commit
723a3eeb04
@ -136,7 +136,7 @@ class AxMinionsCommand {
|
||||
@Subcommand("recalc")
|
||||
@CommandPermission("axminions.command.recalc")
|
||||
fun recalc(player: Player) {
|
||||
val islandId = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration()!!.getIslandAt(player.location)
|
||||
val islandId = AxMinionsAPI.INSTANCE.getIntegrations().getIslandIntegration()?.getIslandAt(player.location) ?: return
|
||||
AxMinionsPlugin.dataQueue.submit {
|
||||
var original = 0
|
||||
if (islandId.isNotBlank()) {
|
||||
@ -149,6 +149,7 @@ class AxMinionsCommand {
|
||||
if (integration is SuperiorSkyBlock2Integration) {
|
||||
val island = SuperiorSkyblockAPI.getIslandAt(player.location) ?: return@submit
|
||||
|
||||
var counter = 0
|
||||
val minions = Minions.getMinions()
|
||||
Environment.entries.forEach { entry ->
|
||||
try {
|
||||
@ -160,12 +161,13 @@ class AxMinionsCommand {
|
||||
val ch = minion.getLocation().chunk
|
||||
if (ch.x == chunk.x && ch.z == chunk.z && ch.world == chunk.world) {
|
||||
AxMinionsPlugin.dataHandler.islandPlace(islandId)
|
||||
counter++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CompletableFuture.allOf(*futures.toTypedArray()).thenRun {
|
||||
player.sendMessage(StringUtils.formatToString(Messages.PREFIX() + Messages.RECALC(), Placeholder.unparsed("from", original.toString()), Placeholder.unparsed("to", futures.size.toString())))
|
||||
player.sendMessage(StringUtils.formatToString(Messages.PREFIX() + Messages.RECALC(), Placeholder.unparsed("from", original.toString()), Placeholder.unparsed("to", counter.toString())))
|
||||
}
|
||||
} catch (_: NullPointerException) {
|
||||
// SuperiorSkyBlock api does it this way aswell
|
||||
|
@ -113,6 +113,7 @@ class MinionPlaceListener : Listener {
|
||||
if (Config.DEBUG()) {
|
||||
event.player.sendMessage("Not return ${islandPlaced >= islandLimit} ${!event.player.hasPermission("axminions.limit.*")}")
|
||||
}
|
||||
islandPlaced++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user