1
0
mirror of https://e.coding.net/circlecloud/MenuProtect.git synced 2024-11-21 10:48:46 +00:00

取消点击监听...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-11-30 16:26:17 +08:00
parent 026cd7a91f
commit db1e3edb4e
3 changed files with 18 additions and 18 deletions

View File

@ -5,11 +5,9 @@ import org.bukkit.Material;
import org.bukkit.entity.Player; 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.InventoryPickupItemEvent; import org.bukkit.event.inventory.InventoryPickupItemEvent;
import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
@ -32,20 +30,22 @@ public class ProtectListener implements Listener {
} }
} }
@EventHandler /*
public void onItemClick(final InventoryClickEvent e) { * @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
final Player p = (Player) e.getWhoClicked(); * public void onItemClick(final InventoryClickEvent e) {
final ItemStack ci = e.getCurrentItem(); * final Player p = (Player) e.getWhoClicked();
final Inventory inv = e.getInventory(); * final ItemStack ci = e.getCurrentItem();
final int solt = e.getSlot(); * final Inventory inv = e.getInventory();
try { * final int solt = e.getSlot();
if (MarkUtil.hasMark(ci)) { * try {
inv.setItem(solt, new ItemStack(Material.AIR)); * if (MarkUtil.hasMark(ci)) {
p.closeInventory(); * inv.setItem(solt, new ItemStack(Material.AIR));
} * p.closeInventory();
} catch (final Exception ex) { * }
} * } catch (final Exception ex) {
} * }
* }
*/
@EventHandler @EventHandler
public void onPlayerHandlerItem(final PlayerItemHeldEvent e) { public void onPlayerHandlerItem(final PlayerItemHeldEvent e) {

View File

@ -1,3 +1,3 @@
MarkList: MarkList:
- '§m§p§r' - '§m§p§r'
- '§q§s§6[§b快捷商店§6] §c悬浮物品§r' - '§q§s§6[§b快捷商店§6] §c悬浮物品§r'

View File

@ -6,7 +6,7 @@ author: 喵♂呜
website: ${jenkins.url}/job/${project.artifactId}/ website: ${jenkins.url}/job/${project.artifactId}/
commands: commands:
${project.artifactId}: ${project.artifactId}:
description: ${project.artifactId} description: ${project.artifactId} - ${project.description}
usage: §b使用/${project.artifactId} help 查看帮助! usage: §b使用/${project.artifactId} help 查看帮助!
permission: ${project.artifactId}.reload permission: ${project.artifactId}.reload
permission-message: §c你没有 <permission> 的权限来执行此命令! permission-message: §c你没有 <permission> 的权限来执行此命令!