public class GlowCraftingInventory extends GlowInventory implements org.bukkit.inventory.CraftingInventory
| Constructor and Description |
|---|
GlowCraftingInventory(org.bukkit.inventory.InventoryHolder owner,
org.bukkit.event.inventory.InventoryType type)
Create an inventory for the 2x2 or 3x3 crafting grid.
|
| Modifier and Type | Method and Description |
|---|---|
void |
craft()
Remove a layer of items from the inventory.
|
org.bukkit.inventory.ItemStack[] |
getMatrix() |
int |
getRawSlots()
Gets the number of slots in this inventory according to the protocol.
|
org.bukkit.inventory.Recipe |
getRecipe() |
org.bukkit.inventory.ItemStack |
getResult() |
void |
handleShiftClick(GlowPlayer player,
org.bukkit.inventory.InventoryView view,
int clickedSlot,
org.bukkit.inventory.ItemStack clickedItem)
Handle a shift click in this inventory by the specified player.
|
boolean |
itemShiftClickAllowed(int slot,
org.bukkit.inventory.ItemStack stack)
Check whether, in a shift-click operation, an item of the specified type may be placed in the
given slot.
|
void |
setItem(int index,
org.bukkit.inventory.ItemStack item) |
void |
setMatrix(org.bukkit.inventory.ItemStack[] contents) |
void |
setResult(org.bukkit.inventory.ItemStack newResult) |
void |
updateResultSlot()
Update the result slot with the current matrix.
|
addItem, addItemStack, addViewer, all, all, all, clear, clear, consumeItem, consumeItem, contains, contains, contains, contains, contains, contains, containsAtLeast, first, first, first, firstEmpty, getContents, getHolder, getItem, getLocation, getMaxStackSize, getName, getSize, getSlot, getSlots, getSlotType, getStorageContents, getTitle, getType, getViewers, getViewersSet, initialize, itemPlaceAllowed, iterator, iterator, remove, remove, remove, removeItem, removeItemStack, removeViewer, setContents, setMaxStackSize, setStorageContents, setTitle, toString, tryToFillSlotsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddItem, all, all, all, clear, clear, contains, contains, contains, contains, contains, contains, containsAtLeast, first, first, first, firstEmpty, getContents, getHolder, getItem, getLocation, getMaxStackSize, getName, getSize, getStorageContents, getTitle, getType, getViewers, iterator, iterator, remove, remove, remove, removeItem, setContents, setMaxStackSize, setStorageContentsforEach, spliteratorpublic GlowCraftingInventory(org.bukkit.inventory.InventoryHolder owner,
org.bukkit.event.inventory.InventoryType type)
owner - the crafting playertype - InventoryType.CRAFTING or InventoryType.WORKBENCHpublic void setItem(int index,
org.bukkit.inventory.ItemStack item)
setItem in interface org.bukkit.inventory.InventorysetItem in class GlowInventorypublic boolean itemShiftClickAllowed(int slot,
org.bukkit.inventory.ItemStack stack)
GlowInventoryitemShiftClickAllowed in class GlowInventoryslot - The slot number.stack - The stack to add.public void handleShiftClick(GlowPlayer player, org.bukkit.inventory.InventoryView view, int clickedSlot, org.bukkit.inventory.ItemStack clickedItem)
GlowInventoryThe default implementation distributes items from the right to the left and from the bottom to the top.
handleShiftClick in class GlowInventoryplayer - The player who clickedview - The inventory view in which was clickedclickedSlot - The slot in the viewclickedItem - The item at which was clickedpublic int getRawSlots()
GlowInventorySome inventories have 0 slots in the protocol, despite having slots.
getRawSlots in class GlowInventorypublic void craft()
public org.bukkit.inventory.ItemStack getResult()
getResult in interface org.bukkit.inventory.CraftingInventorypublic void setResult(org.bukkit.inventory.ItemStack newResult)
setResult in interface org.bukkit.inventory.CraftingInventorypublic org.bukkit.inventory.ItemStack[] getMatrix()
getMatrix in interface org.bukkit.inventory.CraftingInventorypublic void setMatrix(org.bukkit.inventory.ItemStack[] contents)
setMatrix in interface org.bukkit.inventory.CraftingInventorypublic org.bukkit.inventory.Recipe getRecipe()
getRecipe in interface org.bukkit.inventory.CraftingInventorypublic void updateResultSlot()
Copyright © 2021. All rights reserved.