From 44ec03bd30cd8a9139691791292b8a70e2ef33d5 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Wed, 23 Mar 2016 23:00:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E6=AD=A5=E5=8F=91=E9=80=81=E5=95=86?= =?UTF-8?q?=E5=BA=97=E4=BF=A1=E6=81=AF=20=E9=98=B2=E6=AD=A2getOfflinePlaye?= =?UTF-8?q?r=E5=8D=A1=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 34 ++++----- .../org/maxgamer/QuickShop/Util/MsgUtil.java | 69 ++++++++++--------- src/main/resources/plugin.yml | 2 +- 3 files changed, 56 insertions(+), 49 deletions(-) diff --git a/pom.xml b/pom.xml index 99928e4..bc52162 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.maxgamer QuickShop - 1.8.5 + 1.8.6 快捷商店重置版本... ${project.name} @@ -52,18 +52,30 @@ + + Jenkins + http://ci.yumc.pw/job/${project.artifactId}/ + - http://hs.yumc.pw:8080 DEBUG &a全新版本 &c虚拟悬浮物(橙子提供 对 就是那个汉化COI的逗比)&e7老板修复逗比BUG... - &b1.8.5 - &e我是打酱油的 我上个兄弟抽风 不能下载更新...; - &b1.8.4 - &c清理多余的监听事件,修复部分版本不兼容问题 支持1.9...; - &b1.8.3 - &c修复漏斗传输NPE错误...; - &b1.8.2 - &c修复箱子的标题为Null是产生的报错...; + &b1.8.6 - &c修复getOfflinePlayer导致的服务器卡顿(连不上MOJANG...); + &b1.8.4 - &7清理多余的监听事件,修复部分版本不兼容问题 支持1.9...; + &b1.8.3 - &7修复漏斗传输NPE错误...; UTF-8 + + + spigot-repo + https://hub.spigotmc.org/nexus/content/groups/public/ + + + yumc-repo + http://repo.yumc.pw/content/groups/public/ + + jtb @@ -71,16 +83,6 @@ http://repo.yumc.pw/content/repositories/yumcenter/ - - - yumc-repo - ${jenkins.url}/plugin/repository/everything/ - - - spigot-repo - https://hub.spigotmc.org/nexus/content/groups/public/ - - org.spigotmc diff --git a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java index a916a20..fbce108 100644 --- a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java @@ -172,37 +172,42 @@ public class MsgUtil { @SuppressWarnings("deprecation") public static void sendShopInfo(final Player p, final Shop shop, final int stock) { - // Potentially faster with an array? - final ItemStack item = shop.getItem(); - p.sendMessage(""); - 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())); - final String msg = ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.item", shop.getDataName()); - sendItemMessage(p, shop.getItem(), msg); - if (Util.isTool(item.getType())) { - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.damage-percent-remaining", Util.getToolPercentage(item))); - } - if (shop.isSelling()) { - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.stock", "" + (stock == 10000 ? "无限" : stock))); - } else { - final int space = shop.getRemainingSpace(); - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.space", "" + (space == 10000 ? "无限" : space))); - } - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.price-per", shop.getDataName(), Util.format(shop.getPrice()))); - if (shop.isBuying()) { - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-buying")); - } else { - p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-selling")); - } - p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+"); - if (shop.isSelling()) { - p.sendMessage(MsgUtil.p("how-many-buy")); - } else { - final int items = Util.countItems(p.getInventory(), shop.getItem()); - p.sendMessage(MsgUtil.p("how-many-sell", items)); - } + Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { + @Override + public void run() { + // Potentially faster with an array? + final ItemStack item = shop.getItem(); + p.sendMessage(""); + 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())); + final String msg = ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.item", shop.getDataName()); + sendItemMessage(p, shop.getItem(), msg); + if (Util.isTool(item.getType())) { + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.damage-percent-remaining", Util.getToolPercentage(item))); + } + if (shop.isSelling()) { + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.stock", "" + (stock == 10000 ? "无限" : stock))); + } else { + final int space = shop.getRemainingSpace(); + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.space", "" + (space == 10000 ? "无限" : space))); + } + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.price-per", shop.getDataName(), Util.format(shop.getPrice()))); + if (shop.isBuying()) { + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-buying")); + } else { + p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.this-shop-is-selling")); + } + p.sendMessage(ChatColor.DARK_PURPLE + "+---------------------------------------------------+"); + if (shop.isSelling()) { + p.sendMessage(MsgUtil.p("how-many-buy")); + } else { + final int items = Util.countItems(p.getInventory(), shop.getItem()); + p.sendMessage(MsgUtil.p("how-many-sell", items)); + } + } + }); } } \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 1cd8b66..95b1818 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -10,7 +10,7 @@ authors: softdepend: - Vault - WowSuchCleaner -website: ${jenkins.url}/job/${project.artifactId}/ +website: ${ciManagement.url} commands: qs: description: QuickShop 命令