Search in sources :

Example 6 with InventoryCloseEvent

use of org.bukkit.event.inventory.InventoryCloseEvent in project Glowstone by GlowstoneMC.

the class GlowHumanEntity method closeInventory.

@Override
public void closeInventory() {
    EventFactory.getInstance().callEvent(new InventoryCloseEvent(openInventory));
    if (getGameMode() != GameMode.CREATIVE) {
        if (!InventoryUtil.isEmpty(getItemOnCursor())) {
            drop(getItemOnCursor());
        }
        handleUnusedInputs();
    }
    setItemOnCursor(InventoryUtil.createEmptyStack());
    resetInventoryView();
}
Also used : InventoryCloseEvent(org.bukkit.event.inventory.InventoryCloseEvent)

Aggregations

InventoryCloseEvent (org.bukkit.event.inventory.InventoryCloseEvent)6 Window (com.karuslabs.commons.graphics.windows.Window)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 CsvSource (org.junit.jupiter.params.provider.CsvSource)3 InventoryClickType (be.pyrrh4.core.gui.GUI.InventoryClickType)1 Player (org.bukkit.entity.Player)1 InventoryClickEvent (org.bukkit.event.inventory.InventoryClickEvent)1 Inventory (org.bukkit.inventory.Inventory)1 ItemStack (org.bukkit.inventory.ItemStack)1 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)1