From deed3dd4be95d4dfb21d39ac2064508c4c68f374 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Fri, 9 Sep 2016 00:38:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=BC=E5=AE=B91.9+=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=93=8D=E4=BD=9C=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java b/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java index 4e2fc3a..574cda3 100644 --- a/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java +++ b/src/main/java/pw/yumc/YumCore/tellraw/Tellraw.java @@ -12,6 +12,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import pw.yumc.YumCore.bukkit.P; import pw.yumc.YumCore.bukkit.compatible.C; /** @@ -149,7 +150,16 @@ public class Tellraw { */ public void send(final CommandSender sender) { if (sender instanceof Player) { - Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + sender.getName() + " " + toJsonString()); + if (!Bukkit.isPrimaryThread()) { + Bukkit.getScheduler().runTask(P.instance, new Runnable() { + @Override + public void run() { + Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + sender.getName() + " " + toJsonString()); + } + }); + } else { + Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + sender.getName() + " " + toJsonString()); + } } else { sender.sendMessage(toOldMessageFormat()); }