From aec031f91671cc3621ae1c4686b83f50029f1a0a Mon Sep 17 00:00:00 2001 From: 502647092 Date: Mon, 2 Nov 2015 13:43:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9E=84=E5=BB=BA=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- pom.xml | 10 +++++----- .../citycraft/ProtectItem/listen/ClickItemListen.java | 6 ++++-- src/main/resources/plugin.yml | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index f194576..695e98d 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,11 @@ + + http://ci.citycraft.cn:8080 + 完善命令... + UTF-8 + spigot-repo @@ -76,9 +81,4 @@ 1.0 - - http://ci.citycraft.cn:8080 - 完善命令... - UTF-8 - \ No newline at end of file diff --git a/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java b/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java index e3031d0..eafafaa 100644 --- a/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java +++ b/src/main/java/cn/citycraft/ProtectItem/listen/ClickItemListen.java @@ -5,6 +5,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import cn.citycraft.ProtectItem.ProtectItem; @@ -20,12 +21,13 @@ public class ClickItemListen implements Listener { @EventHandler(ignoreCancelled = true) public void onClickItem(final InventoryClickEvent e) { final Player p = (Player) e.getWhoClicked(); - final ItemStack i = e.getCurrentItem(); + final Inventory inv = e.getInventory(); final int solt = e.getSlot(); + final ItemStack i = inv.getItem(solt); if (i != null && i.getType() != Material.AIR) { if (plugin.isCantAction(p, i, ActionType.Click)) { try { - e.getInventory().setItem(solt, new ItemStack(Material.AIR)); + inv.setItem(solt, new ItemStack(Material.AIR)); } catch (final Exception e2) { } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 49ed723..d1e5d24 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} +version: ${project.version}-Build#${env.BUILD_NUMBER} author: 喵♂呜 website: ${jenkins.url}/job/${project.artifactId}/ commands: