mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-12-24 06:58:51 +00:00
feat: 兼容1.9+异步操作错误
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
113701c5bf
commit
deed3dd4be
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user