diff --git a/src/main/java/ovis/futureplots/commands/sub/InfoCommand.java b/src/main/java/ovis/futureplots/commands/sub/InfoCommand.java index dd92a9d..7a9806b 100644 --- a/src/main/java/ovis/futureplots/commands/sub/InfoCommand.java +++ b/src/main/java/ovis/futureplots/commands/sub/InfoCommand.java @@ -20,7 +20,6 @@ import cn.nukkit.Player; import cn.nukkit.command.CommandSender; -import cn.nukkit.utils.TextFormat; import ovis.futureplots.FuturePlots; import ovis.futureplots.commands.SubCommand; import ovis.futureplots.components.util.flags.FlagRegistry; @@ -63,16 +62,13 @@ public void execute(CommandSender sender, String command, String[] args) { final String plotOwner = this.plugin.getCorrectName(plot.getOwner()); final StringBuilder trusted = new StringBuilder(); - final String trustedLastColors = TextFormat.getLastColors(this.translate(player, TranslationKey.INFO_TRUSTED)); - plot.getTrusted().forEach(helper -> trusted.append(this.plugin.getCorrectName(helper)).append("§r§7, ").append(trustedLastColors)); + plot.getTrusted().forEach(trust -> trusted.append(this.translate(player, TranslationKey.INFO_LIST, this.plugin.getCorrectName(trust)))); final StringBuilder helpers = new StringBuilder(); - final String helpersLastColors = TextFormat.getLastColors(this.translate(player, TranslationKey.INFO_HELPERS, "")); - plot.getHelpers().forEach(helper -> helpers.append(this.plugin.getCorrectName(helper)).append("§r§7, ").append(helpersLastColors)); + plot.getHelpers().forEach(helper -> helpers.append(this.translate(player, TranslationKey.INFO_LIST, this.plugin.getCorrectName(helper)))); final StringBuilder denied = new StringBuilder(); - final String deniedLastColors = TextFormat.getLastColors(this.translate(player, TranslationKey.INFO_DENIED, "")); - plot.getDeniedPlayers().forEach(deniedPlayer -> denied.append(this.plugin.getCorrectName(deniedPlayer)).append("§r§7, ").append(deniedLastColors)); + plot.getDeniedPlayers().forEach(deniedPlayer -> denied.append(this.translate(player, TranslationKey.INFO_LIST, this.plugin.getCorrectName(deniedPlayer)))); StringBuilder flags = new StringBuilder(); for (String flagKey : plot.getFlags().keySet()) { @@ -97,13 +93,12 @@ public void execute(CommandSender sender, String command, String[] args) { player.sendMessage(this.translate(player, TranslationKey.INFO_ID, plot.getOriginId())); player.sendMessage(this.translate(player, TranslationKey.INFO_OWNER, plotOwner)); - player.sendMessage(this.translate(player, TranslationKey.INFO_TRUSTED, (trusted.length() > 0 ? trusted.substring(0, trusted.length() - 2 - trustedLastColors.length()) : "§c-----"))); - player.sendMessage(this.translate(player, TranslationKey.INFO_HELPERS, (helpers.length() > 0 ? helpers.substring(0, helpers.length() - 2 - helpersLastColors.length()) : "§c-----"))); - player.sendMessage(this.translate(player, TranslationKey.INFO_DENIED, (denied.length() > 0 ? denied.substring(0, denied.length() - 2 - deniedLastColors.length()) : "§c-----"))); + player.sendMessage(this.translate(player, TranslationKey.INFO_TRUSTED, (trusted.length() >= 2 ? trusted.substring(0, trusted.length() - 2) : "§c-----"))); + player.sendMessage(this.translate(player, TranslationKey.INFO_HELPERS, (helpers.length() >= 2 ? helpers.substring(0, helpers.length() - 2) : "§c-----"))); + player.sendMessage(this.translate(player, TranslationKey.INFO_DENIED, (denied.length() >= 2 ? denied.substring(0, denied.length() - 2) : "§c-----"))); player.sendMessage(this.translate(player, TranslationKey.INFO_FLAGS, flagsBuilderString)); player.sendMessage(this.translate(player, TranslationKey.INFO_END)); - return; } } diff --git a/src/main/java/ovis/futureplots/components/util/language/TranslationKey.java b/src/main/java/ovis/futureplots/components/util/language/TranslationKey.java index 0c1a48e..de201bc 100644 --- a/src/main/java/ovis/futureplots/components/util/language/TranslationKey.java +++ b/src/main/java/ovis/futureplots/components/util/language/TranslationKey.java @@ -117,6 +117,7 @@ public enum TranslationKey { INFO_DAMAGE, INFO_DENIED, INFO_END, + INFO_LIST, INFO_FAILURE, INFO_TRUSTED, INFO_HELPERS, diff --git a/src/main/resources/lang/de_DE.yml b/src/main/resources/lang/de_DE.yml index cc37d2d..c341f83 100644 --- a/src/main/resources/lang/de_DE.yml +++ b/src/main/resources/lang/de_DE.yml @@ -67,11 +67,12 @@ home.failure.own: "§8[§6F§eP§8] §r§cDu besitzt kein Grundstück!" home.failure: "§8[§6F§eP§8] §r§cDer Spieler §r§6%1§r§c besitzt kein Grundstück!" info.title: "§7§6Grundstücks-Info" info.id: "§7ID: §6%1" -info.owner: "§7Besitzer: §6%1" -info.trusted: "§7Vertraute: §6%1" -info.helpers: "§7Helfer: §6%1" -info.denied: "§7Verboten: §6%1" +info.owner: "§7Besitzer: %1" +info.trusted: "§7Vertraute: %1" +info.helpers: "§7Helfer: %1" +info.denied: "§7Verboten: %1" info.end: "§6Grundstücks-Info" +info.list: "§6%1§7, " info.failure: "§8[§6F§eP§8] §r§cDieses Grundstück gehört niemandem." removed.helper: "§8[§6F§eP§8] §r§6%1§r§a ist nun kein Helfer mehr!" no.helper: "§8[§6F§eP§8] §r§6%1§r§c ist kein Helfer!" diff --git a/src/main/resources/lang/en_US.yml b/src/main/resources/lang/en_US.yml index 2bf41de..9dc2fd9 100644 --- a/src/main/resources/lang/en_US.yml +++ b/src/main/resources/lang/en_US.yml @@ -72,6 +72,7 @@ info.trusted: "§7Trusted: §6%1" info.helpers: "§7Helper: §6%1" info.denied: "§7Denied: §6%1" info.end: "§7§6Plot Info" +info.list: "§6%1§7, " info.failure: "§8[§6F§eP§8] §r§cThis plot does not belong to a player." removed.helper: "§8[§6F§eP§8] §r§6%1§r§a is no longer a helper!" no.helper: "§8[§6F§eP§8] §r§6%1§r§c is no helper!"