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: