diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt index 34a2819..1371d61 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt @@ -25,12 +25,18 @@ class CommandTop(plugin: EcoPlugin) : val pageIndex = if (skill == null) 0 else 1 val page = args.getOrNull(pageIndex)?.toIntOrNull() ?: 1 - if (skill == null && args.getOrNull(pageIndex)?.toIntOrNull() == null) { + if ( + skill == null + && args.getOrNull(pageIndex)?.toIntOrNull() == null + && args.getOrNull(pageIndex)?.isBlank() == false + ) { sender.sendMessage(plugin.langYml.getMessage("invalid-skill")) return } - val positions = ((page)..(page + 9)).toList() + val offset = (page - 1) * 10 + + val positions = ((offset + page)..(offset + page + 9)).toList() val top = if (skill == null) { positions.mapNotNull { Skills.getTop(it) } diff --git a/eco-core/core-plugin/src/main/resources/lang.yml b/eco-core/core-plugin/src/main/resources/lang.yml index 0c1145c..411acf7 100644 --- a/eco-core/core-plugin/src/main/resources/lang.yml +++ b/eco-core/core-plugin/src/main/resources/lang.yml @@ -22,7 +22,7 @@ learning-skill: "Learning New Skill..." line-wrap-color: "&8" -top-line-format: "%rank%. %playername% - %level%" +top-line-format: "%rank%. %player% - %level%" top: format: - "---- Skills Leaderboard ----"