40 lines
1.0 KiB
Java
40 lines
1.0 KiB
Java
/**
|
|
*
|
|
*/
|
|
package cn.citycraft.SimpleEssential.listen;
|
|
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.EventPriority;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
|
import org.bukkit.event.inventory.InventoryType;
|
|
import org.bukkit.inventory.Inventory;
|
|
|
|
import cn.citycraft.SimpleEssential.SimpleEssential;
|
|
|
|
/**
|
|
* 玩家随身附魔台记录监听
|
|
*
|
|
* @author 蒋天蓓 2015年8月12日下午8:19:33
|
|
*
|
|
*/
|
|
public class PlayerInventoryViewListen implements Listener {
|
|
SimpleEssential plugin;
|
|
|
|
public PlayerInventoryViewListen(SimpleEssential main) {
|
|
this.plugin = main;
|
|
}
|
|
|
|
@EventHandler(priority = EventPriority.MONITOR)
|
|
public void onInventoryClose(InventoryCloseEvent e) {
|
|
if (!(e.getPlayer() instanceof Player))
|
|
return;
|
|
Player player = (Player) e.getPlayer();
|
|
Inventory inv = e.getInventory();
|
|
if (inv.getType() == InventoryType.ENCHANTING) {
|
|
plugin.invcontrol.clearEnchatRange(player);
|
|
}
|
|
}
|
|
}
|