From e8cce8e620674e920e6a22662833e7363aad3a21 Mon Sep 17 00:00:00 2001 From: Nesseley Date: Mon, 27 Apr 2020 11:21:05 +0200 Subject: [PATCH] Add support for color codes in boss names. Translates color codes for the boss name string right before setting it in the BossWave object. Closes #610 --- changelog.md | 1 + src/main/java/com/garbagemule/MobArena/waves/WaveParser.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index c201b20..7c2c886 100644 --- a/changelog.md +++ b/changelog.md @@ -14,6 +14,7 @@ These changes will (most likely) be included in the next version. - A new `ready` state is now available for arena sign templates. Signs are in this state when all players in the lobby have readied up, but the arena has not yet started due to a start delay timer. Check the wiki for details. - Arena signs now support dynamic list entry variables for 4 different player lists. As an example, `` results in the name of a player in the lobby who hasn't readied up yet. This is useful for visualizing who is holding up the lobby. Check the wiki for details. - Elytra are now supported chest pieces in class chests. +- Boss names now support color codes. - Config-files with missing `pet-items` nodes no longer errors. A missing `pet-items` node in `global-settings` is treated as empty, i.e. no pet items will be registered. ## [0.104.2] - 2020-01-03 diff --git a/src/main/java/com/garbagemule/MobArena/waves/WaveParser.java b/src/main/java/com/garbagemule/MobArena/waves/WaveParser.java index 67051e3..6a90c89 100644 --- a/src/main/java/com/garbagemule/MobArena/waves/WaveParser.java +++ b/src/main/java/com/garbagemule/MobArena/waves/WaveParser.java @@ -21,6 +21,7 @@ import com.garbagemule.MobArena.waves.types.SpecialWave; import com.garbagemule.MobArena.waves.types.SupplyWave; import com.garbagemule.MobArena.waves.types.SwarmWave; import com.garbagemule.MobArena.waves.types.UpgradeWave; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.ItemStack; @@ -254,7 +255,7 @@ public class WaveParser // Check if there's a specific boss name String bossName = config.getString("name", null); if (bossName != null && !bossName.isEmpty()) { - result.setBossName(bossName); + result.setBossName(ChatColor.translateAlternateColorCodes('&', bossName)); } // Grab the boss health