mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
fix message spam bug
This commit is contained in:
parent
05f2763311
commit
1d55c4c2bc
@ -3,6 +3,7 @@ package com.gmail.nossr50.listeners;
|
|||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.WorldBlacklist;
|
import com.gmail.nossr50.config.WorldBlacklist;
|
||||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||||
|
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
@ -891,13 +892,15 @@ public class PlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//If the message is allowed we cancel this event to avoid double sending messages
|
if(mcMMOPlayer.getChatChannel() != ChatChannel.NONE) {
|
||||||
if(plugin.getChatManager().isMessageAllowed(mcMMOPlayer)) {
|
if(plugin.getChatManager().isMessageAllowed(mcMMOPlayer)) {
|
||||||
plugin.getChatManager().processPlayerMessage(mcMMOPlayer, event.getMessage(), event.isAsynchronous());
|
//If the message is allowed we cancel this event to avoid double sending messages
|
||||||
event.setCancelled(true);
|
plugin.getChatManager().processPlayerMessage(mcMMOPlayer, event.getMessage(), event.isAsynchronous());
|
||||||
} else {
|
event.setCancelled(true);
|
||||||
//Message wasn't allowed, remove the player from their channel
|
} else {
|
||||||
plugin.getChatManager().setOrToggleChatChannel(mcMMOPlayer, mcMMOPlayer.getChatChannel());
|
//Message wasn't allowed, remove the player from their channel
|
||||||
|
plugin.getChatManager().setOrToggleChatChannel(mcMMOPlayer, mcMMOPlayer.getChatChannel());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user