- Colour channel name in the You have joined channel messages,

according to the channel message colour.
    - Closes https://github.com/TownyAdvanced/Towny/issues/4503
This commit is contained in:
LlmDl committed 2022-09-30 13:23:37 -05:00
1 parent 0e6544c52f
commit 4c29b4e27d
4 files changed
+7 -4

No files matched your search

+3 -1
View File
@@ -414,4 +414,6 @@ v0.97:
- Closes https://github.com/TownyAdvanced/Towny/issues/6194
- Fix channel sounds being played at the sender's location, fix muting channel sounds.
- Remove built-in HexFormatter.
- Update java to 17 and adopt jabel.
- Update java to 17 and adopt jabel.
- Colour channel name in the You have joined channel messages, according to the channel message colour.
- Closes https://github.com/TownyAdvanced/Towny/issues/4503
@@ -385,7 +385,7 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
Bukkit.getPluginManager().callEvent(new PlayerJoinChatChannelEvent(player, chan));
TownyMessaging.sendMessage(player, Translatable.of("tc_you_joined_channel", chan.getName()));
TownyMessaging.sendMessage(player, Translatable.of("tc_you_joined_channel", Colors.translateColorCodes(chan.getMessageColour()) + chan.getName()));
}
public static void parseChannelSoundToggle(Player player, String[] split) {
@@ -6,6 +6,7 @@ import com.palmergames.bukkit.TownyChat.events.PlayerJoinChatChannelEvent;
import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.object.Translatable;
import com.palmergames.bukkit.util.Colors;
import com.palmergames.util.StringMgmt;
import org.bukkit.Bukkit;
@@ -52,7 +53,7 @@ public class ChannelJoinAliasCommand extends BukkitCommand {
}
plugin.setPlayerChannel(player, channel);
TownyMessaging.sendMessage(player, Translatable.of("tc_you_are_now_talking_in_channel", channel.getName()));
TownyMessaging.sendMessage(player, Translatable.of("tc_you_are_now_talking_in_channel", Colors.translateColorCodes(channel.getMessageColour()) + channel.getName()));
Bukkit.getPluginManager().callEvent(new PlayerJoinChatChannelEvent(player, channel));
return true;
}
@@ -111,7 +111,7 @@ public class StandardChannel extends Channel {
tryPlayChannelSound(event.getRecipients());
if (notifyjoin)
TownyMessaging.sendMessage(player, "You join " + Colors.White + getName());
TownyMessaging.sendMessage(player, "You join " + Colors.translateColorCodes(getMessageColour()) + getName());
/*
* Perform any last channel specific functions like logging this chat and