1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2025-10-02 12:37:27 +00:00

修复PlayerInteractEvent错误参数导致GuiShopManager的报错...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092
2016-01-20 20:54:26 +08:00
parent 764f8a8446
commit 9669c6cc8e
3 changed files with 12 additions and 7 deletions

View File

@ -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);

View File

@ -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