Skip to content

Commit

Permalink
Fixed: The Color Scheme is not being applied properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram1903 committed Oct 12, 2024
1 parent db2127a commit e34c39f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,19 @@ public Component getPrefix() {

public Pair<TextColor, TextColor> getColorScheme() {
final Settings.ColorScheme colorScheme = configManager.getSettings().getColorScheme();
TextColor primaryColor = MiniMessage.miniMessage().deserialize(colorScheme.getPrimaryColor()).color();
TextColor secondaryColor = MiniMessage.miniMessage().deserialize(colorScheme.getSecondaryColor()).color();

// Replace '&' with '§' to convert Minecraft color codes
String primaryColorCode = colorScheme.getPrimaryColor().replace('&', '§');
String secondaryColorCode = colorScheme.getSecondaryColor().replace('&', '§');

// Deserialize the color codes and extract the TextColor
TextColor primaryColor = LegacyComponentSerializer.legacySection().deserialize(primaryColorCode).color();
TextColor secondaryColor = LegacyComponentSerializer.legacySection().deserialize(secondaryColorCode).color();

return new Pair<>(primaryColor, secondaryColor);
}


public Component version() {
return getPrefix()
.append(LegacyComponentSerializer.legacyAmpersand().deserialize(plugin.getConfigManager().getSettings().getPrefix()).decorate(TextDecoration.BOLD))
Expand Down

0 comments on commit e34c39f

Please sign in to comment.