1
0
mirror of https://e.coding.net/circlecloud/ProtectItem.git synced 2024-12-27 20:48:51 +00:00

添加构建版本号 修复一个逻辑错误...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-11-02 13:43:18 +08:00
parent b871b570c0
commit aec031f916
3 changed files with 10 additions and 8 deletions

10
pom.xml
View File

@ -52,6 +52,11 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
<update.description>完善命令...</update.description>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories> <repositories>
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>
@ -76,9 +81,4 @@
<version>1.0</version> <version>1.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
<update.description>完善命令...</update.description>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project> </project>

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import cn.citycraft.ProtectItem.ProtectItem; import cn.citycraft.ProtectItem.ProtectItem;
@ -20,12 +21,13 @@ public class ClickItemListen implements Listener {
@EventHandler(ignoreCancelled = true) @EventHandler(ignoreCancelled = true)
public void onClickItem(final InventoryClickEvent e) { public void onClickItem(final InventoryClickEvent e) {
final Player p = (Player) e.getWhoClicked(); final Player p = (Player) e.getWhoClicked();
final ItemStack i = e.getCurrentItem(); final Inventory inv = e.getInventory();
final int solt = e.getSlot(); final int solt = e.getSlot();
final ItemStack i = inv.getItem(solt);
if (i != null && i.getType() != Material.AIR) { if (i != null && i.getType() != Material.AIR) {
if (plugin.isCantAction(p, i, ActionType.Click)) { if (plugin.isCantAction(p, i, ActionType.Click)) {
try { try {
e.getInventory().setItem(solt, new ItemStack(Material.AIR)); inv.setItem(solt, new ItemStack(Material.AIR));
} catch (final Exception e2) { } catch (final Exception e2) {
} }
} }

View File

@ -1,7 +1,7 @@
name: ${project.artifactId} name: ${project.artifactId}
description: ${project.description} description: ${project.description}
main: ${project.groupId}.${project.artifactId}.${project.artifactId} main: ${project.groupId}.${project.artifactId}.${project.artifactId}
version: ${project.version} version: ${project.version}-Build#${env.BUILD_NUMBER}
author: 喵♂呜 author: 喵♂呜
website: ${jenkins.url}/job/${project.artifactId}/ website: ${jenkins.url}/job/${project.artifactId}/
commands: commands: