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
This commit is contained in:
Nesseley
2020-04-27 11:21:05 +02:00
committed by Andreas Troelsen
parent ce9f07e6b5
commit e8cce8e620
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -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. - 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, `<notready-1>` 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. - Arena signs now support dynamic list entry variables for 4 different player lists. As an example, `<notready-1>` 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. - 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. - 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 ## [0.104.2] - 2020-01-03
@@ -21,6 +21,7 @@ import com.garbagemule.MobArena.waves.types.SpecialWave;
import com.garbagemule.MobArena.waves.types.SupplyWave; import com.garbagemule.MobArena.waves.types.SupplyWave;
import com.garbagemule.MobArena.waves.types.SwarmWave; import com.garbagemule.MobArena.waves.types.SwarmWave;
import com.garbagemule.MobArena.waves.types.UpgradeWave; import com.garbagemule.MobArena.waves.types.UpgradeWave;
import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@@ -254,7 +255,7 @@ public class WaveParser
// Check if there's a specific boss name // Check if there's a specific boss name
String bossName = config.getString("name", null); String bossName = config.getString("name", null);
if (bossName != null && !bossName.isEmpty()) { if (bossName != null && !bossName.isEmpty()) {
result.setBossName(bossName); result.setBossName(ChatColor.translateAlternateColorCodes('&', bossName));
} }
// Grab the boss health // Grab the boss health