Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Adjust event priority and channel shortcut commands so that the plugi…
Browse files Browse the repository at this point in the history
…n works with mute plugins
  • Loading branch information
WiIIiam278 committed Jul 20, 2021
1 parent 7b0cdfc commit e4b1fe7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@
<version>5.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.leoko.advancedban</groupId>
<artifactId>AdvancedBan</artifactId>
<version>2.1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public void execute(CommandSender sender, String[] args) {
message.append(arg).append(" ");
}
final String messageToSend = message.toString();
PlayerListener.sendChatMessage(channelId, player, messageToSend);
final String oldChannelID = HuskChat.getPlayerChannel(player.getUniqueId());
HuskChat.setPlayerChannel(player.getUniqueId(), channelId);
player.chat(messageToSend);
HuskChat.setPlayerChannel(player.getUniqueId(), oldChannelID);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
import net.md_5.bungee.api.event.ChatEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority;

import java.util.HashSet;
import java.util.Locale;

public class PlayerListener implements Listener {

@EventHandler
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerChat(ChatEvent e) {
if (e.isCommand() || e.isProxyCommand()) {
return;
Expand Down

0 comments on commit e4b1fe7

Please sign in to comment.