diff --git a/src/main/java/me/skymc/taboolib/cloud/TCloudCommand.java b/src/main/java/me/skymc/taboolib/cloud/TCloudCommand.java index 4baea78..20f2c78 100644 --- a/src/main/java/me/skymc/taboolib/cloud/TCloudCommand.java +++ b/src/main/java/me/skymc/taboolib/cloud/TCloudCommand.java @@ -218,19 +218,20 @@ public class TCloudCommand extends BaseMainCommand { } Map expansions = type == ExpansionType.PLUGIN ? TCloudLoader.getExpansionPlugins() : TCloudLoader.getExpansionInternal(); int page = args.length < 2 ? 1 : NumberConversions.toInt(args[1]); - if (page < 1 || page > (expansions.size() / 5) + 1) { + int pageMax = (expansions.size() / 5) + ((expansions.size() % 5) == 0 ? 0 : 1); + if (page < 1 || page > pageMax) { TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.INVALID-TYPE.1"); return; } - TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-HEAD", type.name(), String.valueOf(page), String.valueOf((expansions.size() / 5) + 1)); + TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-HEAD", type.name(), String.valueOf(page), String.valueOf(pageMax)); int i = (page - 1) * 5; for (Map.Entry entry : new SimpleIterator(expansions).mapIterator((page - 1) * 5, page * 5)) { if (!TCloudLoader.isExpansionExists(entry.getValue())) { - TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-EXPANSION.0", String.valueOf(++i), entry.getValue().getName(), entry.getValue().getDescription()); + TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-EXPANSION.0", String.valueOf(++i), entry.getValue().getName(), Arrays.toString(entry.getValue().getAuthor())); } else if (entry.getValue().canUpdate()) { - TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-EXPANSION.1", String.valueOf(++i), entry.getValue().getName(), entry.getValue().getDescription()); + TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-EXPANSION.1", String.valueOf(++i), entry.getValue().getName(), Arrays.toString(entry.getValue().getAuthor())); } else { - TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-EXPANSION.2", String.valueOf(++i), entry.getValue().getName(), entry.getValue().getDescription()); + TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-EXPANSION.2", String.valueOf(++i), entry.getValue().getName(), Arrays.toString(entry.getValue().getAuthor())); } } TLocale.sendTo(sender, "COMMANDS.TCLOUD.LIST.LIST-BOTTOM"); diff --git a/src/main/resources/lang/zh_CN.yml b/src/main/resources/lang/zh_CN.yml index 7be8925..832d64f 100644 --- a/src/main/resources/lang/zh_CN.yml +++ b/src/main/resources/lang/zh_CN.yml @@ -622,9 +622,9 @@ COMMANDS: - '&e&l----- &6&lTabooLibCloud Expansions : &f{0} &6&l: &f{1}/{2} &e&l-----' - '' LIST-EXPANSION: - 0: ' &f{0}. &8{1} &f- &7{2}' - 1: ' &f{0}. &c{1} &f- &7{2}' - 2: ' &f{0}. &a{1} &f- &7{2}' + 0: ' &f{0}. &8{1} &7{2}' + 1: ' &f{0}. &c{1} &7{2}' + 2: ' &f{0}. &a{1} &7{2}' LIST-BOTTOM: - '' - ' &f> &8[未安装] &a[已安装] &c[可更新]'