From 9669c6cc8e5ce2d492b4ec9df57be09bc89b82c1 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Wed, 20 Jan 2016 20:54:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPlayerInteractEvent=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=8F=82=E6=95=B0=E5=AF=BC=E8=87=B4GuiShopManager?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- pom.xml | 3 ++- .../org/maxgamer/QuickShop/Shop/ShopManager.java | 14 +++++++++----- src/main/resources/plugin.yml | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 571d1e7..4a73ac1 100644 --- a/pom.xml +++ b/pom.xml @@ -54,8 +54,9 @@ http://ci.citycraft.cn:8080 - DEBUG + DEBUG &a全新版本 &c虚拟悬浮物(橙子提供 对 就是那个汉化COI的逗比) &e7老板修复逗比BUG... + &c修复PlayerInteractEvent错误参数导致GuiShopManager的报错... UTF-8 diff --git a/src/main/java/org/maxgamer/QuickShop/Shop/ShopManager.java b/src/main/java/org/maxgamer/QuickShop/Shop/ShopManager.java index d33941c..d67e7ef 100644 --- a/src/main/java/org/maxgamer/QuickShop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/QuickShop/Shop/ShopManager.java @@ -59,11 +59,15 @@ public class ShopManager { return false; } } - final PlayerInteractEvent pie = new PlayerInteractEvent(p, Action.RIGHT_CLICK_BLOCK, new ItemStack(Material.AIR), b, bf); // PIE = PlayerInteractEvent - What else? - Bukkit.getPluginManager().callEvent(pie); - pie.getPlayer().closeInventory(); // If the player has chat open, this will close their chat. - if (pie.isCancelled()) { - return false; + /* 修复其他插件调用产生的报错... */ + try { + final PlayerInteractEvent pie = new PlayerInteractEvent(p, Action.RIGHT_CLICK_BLOCK, new ItemStack(Material.AIR), b, bf); // PIE = PlayerInteractEvent - What else? + Bukkit.getPluginManager().callEvent(pie); + pie.getPlayer().closeInventory(); // If the player has chat open, this will close their chat. + if (pie.isCancelled()) { + return false; + } + } catch (final Exception e) { } final ShopPreCreateEvent spce = new ShopPreCreateEvent(p, b.getLocation()); Bukkit.getPluginManager().callEvent(spce); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 59e1bc7..1cd8b66 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: ${project.artifactId} description: ${project.description} main: ${project.groupId}.${project.artifactId}.${project.artifactId} -version: ${project.version}-Build#${env.BUILD_NUMBER} +version: ${project.version}-git-${env.GIT_COMMIT} authors: - Netherfoam - Timtower