mirror of
https://e.coding.net/circlecloud/MenuProtect.git
synced 2024-12-27 16:38:48 +00:00
取消点击监听...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
026cd7a91f
commit
db1e3edb4e
@ -5,11 +5,9 @@ import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
|
||||
@ -32,20 +30,22 @@ public class ProtectListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onItemClick(final InventoryClickEvent e) {
|
||||
final Player p = (Player) e.getWhoClicked();
|
||||
final ItemStack ci = e.getCurrentItem();
|
||||
final Inventory inv = e.getInventory();
|
||||
final int solt = e.getSlot();
|
||||
try {
|
||||
if (MarkUtil.hasMark(ci)) {
|
||||
inv.setItem(solt, new ItemStack(Material.AIR));
|
||||
p.closeInventory();
|
||||
}
|
||||
} catch (final Exception ex) {
|
||||
}
|
||||
}
|
||||
/*
|
||||
* @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
* public void onItemClick(final InventoryClickEvent e) {
|
||||
* final Player p = (Player) e.getWhoClicked();
|
||||
* final ItemStack ci = e.getCurrentItem();
|
||||
* final Inventory inv = e.getInventory();
|
||||
* final int solt = e.getSlot();
|
||||
* try {
|
||||
* if (MarkUtil.hasMark(ci)) {
|
||||
* inv.setItem(solt, new ItemStack(Material.AIR));
|
||||
* p.closeInventory();
|
||||
* }
|
||||
* } catch (final Exception ex) {
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerHandlerItem(final PlayerItemHeldEvent e) {
|
||||
|
@ -1,3 +1,3 @@
|
||||
MarkList:
|
||||
- '§m§p§r'
|
||||
- '§q§s§6[§b快捷商店§6] §c悬浮物品§r'
|
||||
- '§q§s§6[§b快捷商店§6] §c悬浮物品§r'
|
||||
|
@ -6,7 +6,7 @@ author: 喵♂呜
|
||||
website: ${jenkins.url}/job/${project.artifactId}/
|
||||
commands:
|
||||
${project.artifactId}:
|
||||
description: ${project.artifactId}
|
||||
description: ${project.artifactId} - ${project.description}
|
||||
usage: §b使用/${project.artifactId} help 查看帮助!
|
||||
permission: ${project.artifactId}.reload
|
||||
permission-message: §c你没有 <permission> 的权限来执行此命令!
|
||||
|
Loading…
Reference in New Issue
Block a user