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
+8
-4
No files matched your search
@@ -7,7 +7,7 @@
|
|||||||
<groupId>com.palmergames.bukkit</groupId>
|
<groupId>com.palmergames.bukkit</groupId>
|
||||||
<artifactId>TownyChat</artifactId>
|
<artifactId>TownyChat</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>0.114</version>
|
<version>0.115</version>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
|||||||
@@ -488,4 +488,6 @@ v0.113:
|
|||||||
- Fix channelTag not parsing properly.
|
- Fix channelTag not parsing properly.
|
||||||
- Closes https://github.com/TownyAdvanced/Towny/issues/7239.
|
- Closes https://github.com/TownyAdvanced/Towny/issues/7239.
|
||||||
v0.114:
|
v0.114:
|
||||||
- Actually fix {channelTag} not parsing properly.
|
- 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 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 CHANNEL_TAG = "channeltag";
|
||||||
|
private static final String LEGACY_CHANNEL_TAG = "channelTag";
|
||||||
private static final String SPAM_TIME = "spam_time";
|
private static final String SPAM_TIME = "spam_time";
|
||||||
private static final String RANGE = "range";
|
private static final String RANGE = "range";
|
||||||
private static final String DEFAULT = "default";
|
private static final String DEFAULT = "default";
|
||||||
@@ -321,11 +322,12 @@ public class ChannelsSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasChannelTag() {
|
public boolean hasChannelTag() {
|
||||||
return channelSettingsMap.containsKey(CHANNEL_TAG);
|
return channelSettingsMap.containsKey(CHANNEL_TAG) || channelSettingsMap.containsKey(LEGACY_CHANNEL_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getChannelTag() {
|
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() {
|
public boolean hasMessageColour() {
|
||||||
|
|||||||
Reference in new issue
Block a user