From 4a180530261a4f63b0a1140e3e88e49ceea09bce Mon Sep 17 00:00:00 2001 From: 17jiong <17jiong@gmail.com> Date: Wed, 31 Jan 2018 18:43:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E8=8E=B7=E5=8F=96=E7=A6=BB=E7=BA=BF=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=88=9B=E5=BB=BA=E5=A4=A7=E9=87=8FgetProfil?= =?UTF-8?q?e=E7=BA=BF=E7=A8=8B=E5=AF=BC=E8=87=B4=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=AB=AF=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE=E9=A2=98=20[16:32?= =?UTF-8?q?:33]=20[Paper=20Watchdog=20Thread/ERROR]:=20Current=20Thread:?= =?UTF-8?q?=20Craft=20Scheduler=20Thread=20-=2014395=20[16:32:33]=20[Paper?= =?UTF-8?q?=20Watchdog=20Thread/ERROR]:=20=09PID:=2018215=20|=20Suspended:?= =?UTF-8?q?=20false=20|=20Native:=20false=20|=20State:=20BLOCKED=20[16:32:?= =?UTF-8?q?33]=20[Paper=20Watchdog=20Thread/ERROR]:=20=09Stack:=20[16:32:3?= =?UTF-8?q?3]=20[Paper=20Watchdog=20Thread/ERROR]:=20=09=09net.minecraft.s?= =?UTF-8?q?erver.v1=5F12=5FR1.UserCache.getProfile(UserCache.java:142)=20[?= =?UTF-8?q?16:32:33]=20[Paper=20Watchdog=20Thread/ERROR]:=20=09=09org.bukk?= =?UTF-8?q?it.craftbukkit.v1=5F12=5FR1.CraftServer.getOfflinePlayer(CraftS?= =?UTF-8?q?erver.java:1352)=20[16:32:33]=20[Paper=20Watchdog=20Thread/ERRO?= =?UTF-8?q?R]:=20=09=09org.bukkit.Bukkit.getOfflinePlayer(Bukkit.java:730)?= =?UTF-8?q?=20[16:32:33]=20[Paper=20Watchdog=20Thread/ERROR]:=20=09=09org.?= =?UTF-8?q?maxgamer.QuickShop.Util.MsgUtil.lambda$3(MsgUtil.java:170)=20[1?= =?UTF-8?q?6:32:33]=20[Paper=20Watchdog=20Thread/ERROR]:=20=09=09org.maxga?= =?UTF-8?q?mer.QuickShop.Util.MsgUtil$$Lambda$448/1914437489.run(Unknown?= =?UTF-8?q?=20Source)=20[16:32:33]=20[Paper=20Watchdog=20Thread/ERROR]:=20?= =?UTF-8?q?=09=09org.bukkit.craftbukkit.v1=5F12=5FR1.scheduler.CraftTask.r?= =?UTF-8?q?un(CraftTask.java:58)=20[16:32:33]=20[Paper=20Watchdog=20Thread?= =?UTF-8?q?/ERROR]:=20=09=09org.bukkit.craftbukkit.v1=5F12=5FR1.scheduler.?= =?UTF-8?q?CraftAsyncTask.run(CraftAsyncTask.java:52)=20[16:32:33]=20[Pape?= =?UTF-8?q?r=20Watchdog=20Thread/ERROR]:=20=09=09com.destroystokyo.paper.S?= =?UTF-8?q?erverSchedulerReportingWrapper.run(ServerSchedulerReportingWrap?= =?UTF-8?q?per.java:22)=20[16:32:33]=20[Paper=20Watchdog=20Thread/ERROR]:?= =?UTF-8?q?=20=09=09java.util.concurrent.ThreadPoolExecutor.runWorker(Thre?= =?UTF-8?q?adPoolExecutor.java:1149)=20[16:32:33]=20[Paper=20Watchdog=20Th?= =?UTF-8?q?read/ERROR]:=20=09=09java.util.concurrent.ThreadPoolExecutor$Wo?= =?UTF-8?q?rker.run(ThreadPoolExecutor.java:624)=20[16:32:33]=20[Paper=20W?= =?UTF-8?q?atchdog=20Thread/ERROR]:=20=09=09java.lang.Thread.run(Thread.ja?= =?UTF-8?q?va:748)=20[16:32:33]=20[Paper=20Watchdog=20Thread/ERROR]:=20---?= =?UTF-8?q?---------------------------?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java index 738f8e5..5420071 100644 --- a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java @@ -106,7 +106,7 @@ public class MsgUtil { */ public static void send(final String player, final String message) { Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { - final OfflinePlayer p = Bukkit.getOfflinePlayer(player); + final Player p = Bukkit.getPlayerExact(player); if (p == null || !p.isOnline()) { LinkedList msgs = player_messages.computeIfAbsent(player, k -> new LinkedList<>()); msgs.add(message); @@ -166,8 +166,7 @@ public class MsgUtil { p.sendMessage(""); p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+"); p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.shop-information")); - p.sendMessage(ChatColor.DARK_PURPLE + "| " - + MsgUtil.p("menu.owner", Bukkit.getOfflinePlayer(shop.getOwner()).getName() == null ? (shop.isUnlimited() ? "系统商店" : "未知") : Bukkit.getOfflinePlayer(shop.getOwner()).getName())); + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.owner", shop.getOwner() == null ? (shop.isUnlimited() ? "系统商店" : "未知") : shop.getOwner())); final String msg = ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.item", shop.getDataName()); sendItemMessage(p, shop.getItem(), msg); if (Util.isTool(item.getType())) {