Add total chunk count to list command (closes #79) (#82)

pull/83/head
Trivernis 4 years ago committed by GitHub
parent acf302e8c1
commit 1f167285b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
}
}
Loading…
Cancel
Save