- Fix default channels not being returned if TownyChat is searching

for a channel of that type.
    - Closes https://github.com/TownyAdvanced/Towny/issues/4984
This commit is contained in:
Llm Dl committed 2021-08-22 15:14:50 -05:00
1 parent 226ae6ee30
commit 9710f43544
2 files changed
+7 -1

No files matched your search

+3 -1
View File
@@ -379,4 +379,6 @@ v0.89:
- Update min. Towny to 0.97.0.0 and remove NotRegisteredException catches.
- Add support for EssentialsDiscord, courtesy of JRoy with PR #33.
v0.90:
- Allow channeltags to make use of hex colour formatting.
- Allow channeltags to make use of hex colour formatting.
- Fix default channels not being returned if TownyChat is searching for a channel of that type.
- Closes https://github.com/TownyAdvanced/Towny/issues/4984
@@ -105,6 +105,10 @@ public class ChannelsHolder {
String name = player.getName();
// Return the defaultChan if it is the correct type, and the player is present in that channel.
if (getDefaultChannel() != null && getDefaultChannel().isPresent(name) && getDefaultChannel().getType().equals(type))
return getDefaultChannel();
for (Channel channel: channels.values()) {
if (!channel.isPresent(name)) continue;
if (!channel.getType().equals(type)) continue;