stop players in tutorial from receiving/sending chat.

This commit is contained in:
NewGarbo 2015-11-26 13:16:50 +00:00
parent bbfd319bcd
commit 009ddaaee1

View File

@ -3,6 +3,7 @@ package mineplex.game.clans.tutorials.types;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
@ -66,6 +67,21 @@ public class TutorialGettingStarted extends Tutorial
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void handlePlayerChat(AsyncPlayerChatEvent event)
{
for (TutorialClient player : _inTutorial.values())
{
if (event.getPlayer().equals(player.getPlayer()))
{
event.setCancelled(true);
continue;
}
event.getRecipients().remove(player.getPlayer());
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onClansCommand(ClansCommandExecutedEvent event)
{