mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 14:38:58 +00:00
Stop announcing new channels when it's the same channel
This commit is contained in:
1 parent
0de0edee00
commit
333282901f
1 file changed
+4
-2
@@ -86,7 +86,7 @@ public class LeaveCommand implements CommandExecutor {
|
|||||||
// Announce it
|
// Announce it
|
||||||
TownyMessaging.sendMsg(sender, "[TownyChat] You left " + Colors.White + chan.getName());
|
TownyMessaging.sendMsg(sender, "[TownyChat] You left " + Colors.White + chan.getName());
|
||||||
|
|
||||||
|
// Find what the next channel is if any
|
||||||
Channel nextChannel = null;
|
Channel nextChannel = null;
|
||||||
if (plugin.getTowny().hasPlayerMode(player, chan.getName())) {
|
if (plugin.getTowny().hasPlayerMode(player, chan.getName())) {
|
||||||
if (plugin.getChannelsHandler().getDefaultChannel() != null && plugin.getChannelsHandler().getDefaultChannel().isPresent(player.getName())) {
|
if (plugin.getChannelsHandler().getDefaultChannel() != null && plugin.getChannelsHandler().getDefaultChannel().isPresent(player.getName())) {
|
||||||
@@ -99,7 +99,9 @@ public class LeaveCommand implements CommandExecutor {
|
|||||||
if (nextChannel == null) {
|
if (nextChannel == null) {
|
||||||
nextChannel = plugin.getChannelsHandler().getActiveChannel(player, channelTypes.GLOBAL);
|
nextChannel = plugin.getChannelsHandler().getActiveChannel(player, channelTypes.GLOBAL);
|
||||||
}
|
}
|
||||||
if (nextChannel != null) {
|
|
||||||
|
// If the new channel is not us, announce it
|
||||||
|
if (nextChannel != null && !chan.getName().equalsIgnoreCase(nextChannel.getName())) {
|
||||||
TownyMessaging.sendMsg(sender, "[TownyChat] You are now talking in " + Colors.White + nextChannel.getName());
|
TownyMessaging.sendMsg(sender, "[TownyChat] You are now talking in " + Colors.White + nextChannel.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user