mirror of
https://github.com/TotalFreedomMC/TF-Marriage.git
synced 2024-12-31 20:42:18 +00:00
Block partner chat with Herochat
This commit is contained in:
parent
cf34fb34f4
commit
875af5b056
2 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue