From c35acc38fcdb2a88c78e5da4e4c5112d48c1218e Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 10 Nov 2023 20:26:12 -0700 Subject: [PATCH] Remove default per-locale channel formats --- .../carbon/common/channels/PartyChatChannel.java | 4 ---- .../channels/messages/ConfigChannelMessageSource.java | 10 ++++------ .../paper/integration/towny/AllianceChannel.java | 4 ---- .../carbon/paper/integration/towny/NationChannel.java | 4 ---- .../carbon/paper/integration/towny/TownChannel.java | 4 ---- 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/common/src/main/java/net/draycia/carbon/common/channels/PartyChatChannel.java b/common/src/main/java/net/draycia/carbon/common/channels/PartyChatChannel.java index e2136c28..e715dabc 100644 --- a/common/src/main/java/net/draycia/carbon/common/channels/PartyChatChannel.java +++ b/common/src/main/java/net/draycia/carbon/common/channels/PartyChatChannel.java @@ -22,7 +22,6 @@ package net.draycia.carbon.common.channels; import com.google.inject.Inject; import java.util.ArrayList; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.UUID; @@ -60,9 +59,6 @@ public class PartyChatChannel extends ConfigChatChannel { "default_format", "(party: ) : ", "console", "[party: ] : " ); - this.messageSource.locales = Map.of( - Locale.US, Map.of("default_format", "(party: ) : ") - ); } @Override diff --git a/common/src/main/java/net/draycia/carbon/common/channels/messages/ConfigChannelMessageSource.java b/common/src/main/java/net/draycia/carbon/common/channels/messages/ConfigChannelMessageSource.java index 364f7749..cb7059b0 100644 --- a/common/src/main/java/net/draycia/carbon/common/channels/messages/ConfigChannelMessageSource.java +++ b/common/src/main/java/net/draycia/carbon/common/channels/messages/ConfigChannelMessageSource.java @@ -63,15 +63,13 @@ public class ConfigChannelMessageSource implements IMessageSource" ); - // TODO: Move the default to the advanced config? @Comment(""" Per-Language chat formats. - You can safely delete this section if you don't want to use this feature. - Will fall back to the defaults section if no format was found for the player. + You can safely leave this section empty if you don't want to use this feature. + Each locale section can be configured in the same way as the above 'basic' section. + Will fall back to the 'basic' section if no format was found for the player's locale. """) - public Map> locales = Map.of( - Locale.US, Map.of("default_format", ": ") - ); + public Map> locales = Map.of(Locale.getDefault(), Map.of()); private static final String FALLBACK_FORMAT = "<> "; diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java index 1492ecd3..f171b2e6 100644 --- a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/AllianceChannel.java @@ -21,7 +21,6 @@ package net.draycia.carbon.paper.integration.towny; import com.palmergames.bukkit.towny.object.Nation; import java.util.List; -import java.util.Locale; import java.util.Map; import net.draycia.carbon.api.users.CarbonPlayer; import net.draycia.carbon.common.channels.messages.ConfigChannelMessageSource; @@ -49,9 +48,6 @@ public class AllianceChannel extends NationChannel { "default_format", "(alliance) : ", "console", "[alliance] : " ); - this.messageSource.locales = Map.of( - Locale.US, Map.of("default_format", "(alliance) : ") - ); } @Override diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java index a0c195f8..6c45367e 100644 --- a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/NationChannel.java @@ -22,7 +22,6 @@ package net.draycia.carbon.paper.integration.towny; import com.palmergames.bukkit.towny.object.Nation; import com.palmergames.bukkit.towny.object.Resident; import java.util.List; -import java.util.Locale; import java.util.Map; import net.draycia.carbon.api.users.CarbonPlayer; import net.draycia.carbon.common.channels.messages.ConfigChannelMessageSource; @@ -50,9 +49,6 @@ public class NationChannel extends ResidentListChannel { "default_format", "(nation: %townyadvanced_nation_unformatted%) : ", "console", "[nation: %townyadvanced_nation_unformatted%] : " ); - this.messageSource.locales = Map.of( - Locale.US, Map.of("default_format", "(nation: %townyadvanced_nation_unformatted%) : ") - ); } @Override diff --git a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java index e9385ae0..c5143296 100644 --- a/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java +++ b/paper/src/main/java/net/draycia/carbon/paper/integration/towny/TownChannel.java @@ -22,7 +22,6 @@ package net.draycia.carbon.paper.integration.towny; import com.palmergames.bukkit.towny.object.Resident; import com.palmergames.bukkit.towny.object.Town; import java.util.List; -import java.util.Locale; import java.util.Map; import net.draycia.carbon.api.users.CarbonPlayer; import net.draycia.carbon.common.channels.messages.ConfigChannelMessageSource; @@ -50,9 +49,6 @@ public class TownChannel extends ResidentListChannel { "default_format", "(town: %townyadvanced_town_unformatted%) : ", "console", "[town: %townyadvanced_town_unformatted%] : " ); - this.messageSource.locales = Map.of( - Locale.US, Map.of("default_format", "(town: %townyadvanced_town_unformatted%) : ") - ); } @Override