mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-01 14:38:57 +00:00
- Add support for channels.yml's with legacy channelTag keys. (#59)
This commit is contained in:
1 parent
e8166d498f
commit
ba695ae06c
3 files changed
+7
-3
No files matched your search
@@ -7,7 +7,7 @@
|
||||
<groupId>com.palmergames.bukkit</groupId>
|
||||
<artifactId>TownyChat</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>0.114</version>
|
||||
<version>0.115</version>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
|
||||
@@ -489,3 +489,5 @@ v0.113:
|
||||
- Closes https://github.com/TownyAdvanced/Towny/issues/7239.
|
||||
v0.114:
|
||||
- Actually fix {channelTag} not parsing properly.
|
||||
v0.115:
|
||||
- Add support for channels.yml's with legacy channelTag keys.
|
||||
@@ -27,6 +27,7 @@ public class ChannelsSettings {
|
||||
private final static List<String> DEFAULT_CHANNELS = Arrays.asList("general","town","nation","alliance","admin","mod","local");
|
||||
|
||||
private static final String CHANNEL_TAG = "channeltag";
|
||||
private static final String LEGACY_CHANNEL_TAG = "channelTag";
|
||||
private static final String SPAM_TIME = "spam_time";
|
||||
private static final String RANGE = "range";
|
||||
private static final String DEFAULT = "default";
|
||||
@@ -321,11 +322,12 @@ public class ChannelsSettings {
|
||||
}
|
||||
|
||||
public boolean hasChannelTag() {
|
||||
return channelSettingsMap.containsKey(CHANNEL_TAG);
|
||||
return channelSettingsMap.containsKey(CHANNEL_TAG) || channelSettingsMap.containsKey(LEGACY_CHANNEL_TAG);
|
||||
}
|
||||
|
||||
public String getChannelTag() {
|
||||
return (String) channelSettingsMap.getOrDefault(CHANNEL_TAG, "");
|
||||
String slug = channelSettingsMap.containsKey(LEGACY_CHANNEL_TAG) ? LEGACY_CHANNEL_TAG : CHANNEL_TAG;
|
||||
return (String) channelSettingsMap.getOrDefault(slug, "");
|
||||
}
|
||||
|
||||
public boolean hasMessageColour() {
|
||||
|
||||
Reference in new issue
Block a user