From f3a0b329a687e95e137ef731db2fc0a266210256 Mon Sep 17 00:00:00 2001 From: Lilly <46890129+RainbowDashLabs@users.noreply.github.com> Date: Thu, 2 May 2024 09:37:54 +0200 Subject: [PATCH] Fix some UI issues --- .../bloodnight/command/bloodnight/ManageMob.java | 11 ++++++----- .../bloodnight/command/bloodnight/ManageWorlds.java | 4 ++-- .../managedeathactions/ManageMonsterDeathActions.java | 4 ++-- .../managedeathactions/ManagePlayerDeathActions.java | 10 +++++----- .../eldoria/bloodnight/command/util/CommandUtil.java | 3 ++- .../src/main/resources/messages.properties | 3 ++- .../src/main/resources/messages_de_DE.properties | 1 + .../src/main/resources/messages_en_US.properties | 1 + 8 files changed, 21 insertions(+), 16 deletions(-) diff --git a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/ManageMob.java b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/ManageMob.java index ad54140b..529aa2cf 100644 --- a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/ManageMob.java +++ b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/ManageMob.java @@ -265,9 +265,9 @@ private void sendMobListPage(World world, CommandSender sender, Map.Entry%s: %s %s %s %s %s Health Modifier: %s %s %s - %s: %s %s + %s Damage Modifier: %s %s %s - %s: %s %s + %s """.stripIndent() .formatted( // Mob name state @@ -277,17 +277,18 @@ private void sendMobListPage(World world, CommandSender sender, Map.Entry<%s> %s %s %s @@ -126,11 +125,12 @@ private void sendWorldPage(World world, CommandSender sender, int page) { %s: %s %s %s """.stripIndent() .formatted( + // header entry.getWorldName(), CommandUtil.getBooleanField(entry.isEnabled(), cmd + "state {bool} ", "", "state.enabled", "state.disabled"), CommandUtil.getBooleanField(entry.isCreeperBlockDamage(), cmd + "creeperBlockDamage {bool} ", "field.creeperBlockDamage", "state.enabled", "state.disabled"), CommandUtil.getBooleanField(entry.isAlwaysManageCreepers(), cmd + "manageCreeperAlways {bool} ", "field.alwaysManageCreepers", "state.enabled", "state.disabled"), escape("field.bossBarSettings"), - CommandUtil.getBooleanField(bbs.isEnabled(), cmd + "bossBar state {bool} ", "", "state.enabled", "state.disabled"), + CommandUtil.getBooleanField(bbs.isEnabled(), cmd + "bossBar state {bool} ", "field.state", "state.enabled", "state.disabled"), escape("field.title"), bbs.getTitle(), cmd + "bossBar title " + bbs.getTitle(), escape("action.change"), escape("field.color"), bbs.getColor(), cmd + "bossBar color ", escape("action.change"), escape("field.effects"), diff --git a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManageMonsterDeathActions.java b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManageMonsterDeathActions.java index 9cde249f..cd1ed6c8 100644 --- a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManageMonsterDeathActions.java +++ b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManageMonsterDeathActions.java @@ -49,7 +49,7 @@ MobDeathActions actions(Player player, Arguments args) { } void sendMobDeathActions(Player player, World world) { - String cmd = "/bloodnight deathActions monster {command} " + ArgumentUtils.escapeWorldName(world.getName()); + String cmd = "/bloodnight manageDeathActions monster {command} " + ArgumentUtils.escapeWorldName(world.getName()); String action = """ %s %s [%s] @@ -97,7 +97,7 @@ static class Shockwave extends Base implements IPlayerTabExecutor { private final Configuration configuration; public Shockwave(Plugin plugin, Configuration configuration) { - super(plugin, CommandMeta.builder("lightning").hidden().build(), configuration); + super(plugin, CommandMeta.builder("shockwave").hidden().build(), configuration); this.configuration = configuration; } diff --git a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManagePlayerDeathActions.java b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManagePlayerDeathActions.java index b3185953..06cd5867 100644 --- a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManagePlayerDeathActions.java +++ b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/bloodnight/managedeathactions/ManagePlayerDeathActions.java @@ -210,23 +210,23 @@ public void onCommand(@NotNull Player player, @NotNull String alias, @NotNull Ar } private void sendPlayerDeathActions(Player player, World world, PlayerDeathActions playerDeathActions) { - String cmd = "/bloodnight deathActions player " + ArgumentUtils.escapeWorldName(world.getName()) + " "; + String cmd = "/bloodnight manageDeathActions player " + ArgumentUtils.escapeWorldName(world.getName()) + " "; var actions = """ %s %s [%s] %s [%s] %s [%s] [%s] %s [%s] - %s [%s] - %s: %s [%s] - %s: %s [%s] + %s: + %s: %s [%s] + %s: %s [%s] """.stripIndent() .formatted(CommandUtil.getHeader("manageDeathActions.player.title"), escape("field.lightningSettings"), cmd + "lightning", escape("action.change"), escape("field.shockwaveSettings"), cmd + "shockwave", escape("action.change"), escape("field.deathCommands"), cmd + "commands", escape("action.change"), cmd + "addCommand", escape("action.add"), escape("field.respawnEffect"), cmd + "effects", escape("action.change"), - escape("field.loseInventory"), cmd + "loseInv", escape("action.change"), + escape("field.loseInventory"), escape("field.loseInventory"), playerDeathActions.getLoseInvProbability(), cmd + "loseInv ", escape("action.change"), escape("field.loseExperience"), playerDeathActions.getLoseExpProbability(), cmd + "loseExp ", escape("action.change") ); diff --git a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/util/CommandUtil.java b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/util/CommandUtil.java index afc72b06..0138cfd1 100644 --- a/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/util/CommandUtil.java +++ b/BloodNight-core/src/main/java/de/eldoria/bloodnight/command/util/CommandUtil.java @@ -94,7 +94,8 @@ public static String getPage(Collection content, int page, int elementsPe builder.newLine(); } - builder.text("=====<| %s |>=====", escape(title)); + builder.text("=====<| %s |>=====", escape(title)) + .newLine(); builder.text(elements.stream().map(mapping).toList()); return builder.newLine().text(getPageFooter(page, CommandUtil.pageCount(content, elementsPerPage), pageCommand)).build(); diff --git a/BloodNight-core/src/main/resources/messages.properties b/BloodNight-core/src/main/resources/messages.properties index 42bfb45f..25c9f51d 100644 --- a/BloodNight-core/src/main/resources/messages.properties +++ b/BloodNight-core/src/main/resources/messages.properties @@ -75,7 +75,8 @@ field.nightDuration=Night duration field.nightEnd=Night End field.nightSelectionType=Night Selection Type field.overrideDefaultDrops=Override Default Drops -field.overrideDuration=Override duration +field.overrideDuration=Override duration# +field.state=State field.phase=Phase field.power=Power field.probability=Probability diff --git a/BloodNight-core/src/main/resources/messages_de_DE.properties b/BloodNight-core/src/main/resources/messages_de_DE.properties index 20cc371d..f15a35e8 100644 --- a/BloodNight-core/src/main/resources/messages_de_DE.properties +++ b/BloodNight-core/src/main/resources/messages_de_DE.properties @@ -81,6 +81,7 @@ field.probability=Wahrscheinlichkeit field.range=Reichweite field.respawnEffect=Respawn Effekte field.shockwaveSettings=Schockwelle Einstellungen +field.state=Status field.showMobNames=Zeige Mob Namen field.sleep=Schlafen field.spawnPercentage=Spawn Wahrscheinlichkeit diff --git a/BloodNight-core/src/main/resources/messages_en_US.properties b/BloodNight-core/src/main/resources/messages_en_US.properties index d6e838b3..96be89c0 100644 --- a/BloodNight-core/src/main/resources/messages_en_US.properties +++ b/BloodNight-core/src/main/resources/messages_en_US.properties @@ -155,6 +155,7 @@ state.allow=allow state.combine=combine state.curve=Curve state.custom=custom +field.state=State state.darkenSky=Darken Sky state.default=default state.deny=deny