Block partner chat with Herochat

This commit is contained in:
Lennart ten Wolde 2014-03-13 08:56:11 +01:00
parent cf34fb34f4
commit 875af5b056
2 changed files with 5 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import com.dthielke.herochat.ChannelChatEvent;
import com.dthielke.herochat.Chatter.Result;
import com.lenis0012.bukkit.marriage.MPlayer;
import com.lenis0012.bukkit.marriage.Marriage;
@ -19,7 +20,9 @@ public class HerochatListener implements Listener {
public void onChannelChat(ChannelChatEvent event) {
Player player = event.getSender().getPlayer();
MPlayer mp = plugin.getMPlayer(player);
if(mp.isMarried()) {
if(mp.isChatting()) {
event.setResult(Result.INVALID); //Hide partner chat
} if(mp.isMarried()) {
if(plugin.getConfig().getBoolean("settings.chat-prefix.use")) {
String format = plugin.getConfig().getString("settings.chat-prefix.format");
format = plugin.fixColors(format);

View file

@ -65,10 +65,8 @@ public class PlayerListener implements Listener {
}
event.setCancelled(true);
//HeroChat fix?
event.getRecipients().clear();
} else if(mp.isMarried()) {
//Replace chat with cusotm prefix
//Replace chat with custom prefix
if(plugin.getConfig().getBoolean("settings.chat-prefix.use")) {
String format = plugin.getConfig().getString("settings.chat-prefix.format");
format = plugin.fixColors(format);