Made msgs not send to Discord if cancelled
This commit is contained in:
parent
f7b1090670
commit
41f6cc342d
1 changed files with 4 additions and 2 deletions
|
@ -22,6 +22,8 @@ import sx.blah.discord.handle.obj.IUser;
|
||||||
public class MCChatListener implements Listener, IListener<MessageReceivedEvent> {
|
public class MCChatListener implements Listener, IListener<MessageReceivedEvent> {
|
||||||
@EventHandler // Minecraft
|
@EventHandler // Minecraft
|
||||||
public void onMCChat(TBMCChatEvent e) {
|
public void onMCChat(TBMCChatEvent e) {
|
||||||
|
if (e.isCancelled())
|
||||||
|
return;
|
||||||
if (e.getSender() instanceof DiscordSender || e.getSender() instanceof DiscordPlayerSender)
|
if (e.getSender() instanceof DiscordSender || e.getSender() instanceof DiscordPlayerSender)
|
||||||
return;
|
return;
|
||||||
if (e.getChannel().equals(Channel.GlobalChat))
|
if (e.getChannel().equals(Channel.GlobalChat))
|
||||||
|
@ -32,8 +34,8 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
|
||||||
+ DiscordPlugin.sanitizeString(e.getMessage()));
|
+ DiscordPlugin.sanitizeString(e.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String[] UnconnectedCmds = new String[] { "list", "u", "shrug", "tableflip", "unflip",
|
private static final String[] UnconnectedCmds = new String[] { "list", "u", "shrug", "tableflip", "unflip", "mwiki",
|
||||||
"mwiki", "t" };
|
"t" };
|
||||||
|
|
||||||
public static final HashMap<String, DiscordSender> UnconnectedSenders = new HashMap<>();
|
public static final HashMap<String, DiscordSender> UnconnectedSenders = new HashMap<>();
|
||||||
public static final HashMap<String, DiscordPlayerSender> ConnectedSenders = new HashMap<>();
|
public static final HashMap<String, DiscordPlayerSender> ConnectedSenders = new HashMap<>();
|
||||||
|
|
Loading…
Reference in a new issue