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