package team.unstudio.udpl.util;

import org.apache.commons.lang3.NotImplementedException;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;

public interface ChatUtils {

	String SPLITTER = translateColorCodes("&l&m----------------------------------------------------------------");
	char DEFAULT_COLOR_CHAR = '&';

	/**
	 * 发送分割线
	 */
	static void sendSplitter(Player player){
		player.sendMessage(SPLITTER);
	}

	/**
	 * 发送空行
	 */
	static void sendEmpty(Player player){
		player.sendMessage("");
	}

	/**
	 * 发送清屏消息
	 */
	static void sendCleanScreen(Player player) {
		for (int i = 0; i < 20; i++) sendEmpty(player);
	}

	/**
	 * 将文本中'&'转换为颜色字符
	 */
	static String translateColorCodes(String textToTranslate){
		return ChatColor.translateAlternateColorCodes(DEFAULT_COLOR_CHAR, textToTranslate);
	}

	/**
	 * 玩家停止接收消息<br>
	 * 该方法将会将发送给玩家的消息拦截并缓存，直到调用{@link ChatUtils#startReceiveChat(Player)}方法。
	 * @see ChatUtils#startReceiveChat(Player)
	 */
	static void stopReceiveChat(Player player) {
        throw new NotImplementedException("");
	}

	/**
	 * 玩家开始接收消息<br>
	 * 该方法将会将已拦截的玩家消息发送，并且该发送是逐步的，使玩家可以阅读未读的消息。
	 * @see ChatUtils#stopReceiveChat(Player)
	 */
	static void startReceiveChat(Player player) {
        throw new NotImplementedException("");
	}
}

@@ -113,16 +113,57 @@
 tColor;%0A
+import org.bukkit.command.CommandSender;%0A
 import o
@@ -409,38 +409,45 @@
 plitter(
-Player play
+CommandSender send
 er)%7B%0A%09%09
-play
+send
 er.sendM
@@ -514,30 +514,37 @@
 pty(
-Player play
+CommandSender send
 er)%7B%0A%09%09
-play
+send
 er.s
@@ -613,27 +613,34 @@
 nScreen(
-Player play
+CommandSender send
 er) %7B%0A%09%09
@@ -678,20 +678,20 @@
 ndEmpty(
-play
+send
 er);%0A%09%7D%0A

Update ChatUtils