From 1f167285b0c8d82aefde64dcbc74c0a43449f4e0 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Sun, 26 Jul 2020 16:58:20 +0200 Subject: [PATCH] Add total chunk count to list command (closes #79) (#82) --- .../kotlin/net/trivernis/chunkmaster/commands/CmdList.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/trivernis/chunkmaster/commands/CmdList.kt b/src/main/kotlin/net/trivernis/chunkmaster/commands/CmdList.kt index a4752dc..54082ce 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/commands/CmdList.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/commands/CmdList.kt @@ -5,6 +5,7 @@ import net.trivernis.chunkmaster.lib.Subcommand import net.trivernis.chunkmaster.lib.generation.taskentry.TaskEntry import org.bukkit.command.Command import org.bukkit.command.CommandSender +import kotlin.math.ceil class CmdList(private val chunkmaster: Chunkmaster): Subcommand { override val name = "list" @@ -52,7 +53,12 @@ class CmdList(private val chunkmaster: Chunkmaster): Subcommand { " (%.1f".format(genTask.shape.progress()*100) + "%)." else "" + val count = if (genTask.radius > 0) { + "${genTask.count} / ${ceil(genTask.shape.total()).toInt()}" + } else { + genTask.count.toString() + } return "\n" + chunkmaster.langManager.getLocalized("TASKS_ENTRY", - task.id, genTask.world.name, genTask.state.toString(), genTask.count, percentage) + task.id, genTask.world.name, genTask.state.toString(), count, percentage) } } \ No newline at end of file