Package net.glowstone.inventory
Class GlowAnvilInventory
java.lang.Object
net.glowstone.inventory.GlowInventory
net.glowstone.inventory.GlowAnvilInventory
- All Implemented Interfaces:
Iterable<org.bukkit.inventory.ItemStack>,org.bukkit.inventory.AnvilInventory,org.bukkit.inventory.Inventory
public class GlowAnvilInventory
extends GlowInventory
implements org.bukkit.inventory.AnvilInventory
-
Constructor Summary
ConstructorsConstructorDescriptionGlowAnvilInventory(org.bukkit.inventory.InventoryHolder holder) Creates an instance for the given player. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackorg.bukkit.inventory.ItemStackReturns the item that will result when this anvil is applied to the currently loaded items, combining them, provided that two items which can be combined are loaded.intintGets the number of slots in this inventory according to the protocol.intorg.bukkit.inventory.ItemStackorg.bukkit.inventory.ItemStackvoidhandleShiftClick(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.voidsetItem(int index, org.bukkit.inventory.ItemStack item) voidsetMaximumRepairCost(int maximumRepairCost) voidsetRenameText(String name) Sets the name of the next item to be modified on this anvil.voidsetRepairCost(int repairCost) Methods inherited from class net.glowstone.inventory.GlowInventory
addItem, addItemStack, addViewer, all, all, clear, clear, close, consumeItem, consumeItem, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getHolder, getHolder, getItem, getLocation, getMaxStackSize, getSize, getSlot, getSlots, getSlotType, getStorageContents, getTitle, getType, getViewers, getViewersSet, initialize, isEmpty, itemPlaceAllowed, itemShiftClickAllowed, iterator, iterator, remove, remove, removeItem, removeItemAnySlot, removeItemStack, removeViewer, setContents, setMaxStackSize, setStorageContents, setTitle, toString, tryToFillSlotsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.inventory.AnvilInventory
getResult, setFirstItem, setResult, setSecondItemMethods inherited from interface org.bukkit.inventory.Inventory
addItem, all, all, clear, clear, close, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getHolder, getHolder, getItem, getLocation, getMaxStackSize, getSize, getStorageContents, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, removeItemAnySlot, setContents, setMaxStackSize, setStorageContentsMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GlowAnvilInventory
public GlowAnvilInventory(org.bukkit.inventory.InventoryHolder holder) Creates an instance for the given player.- Parameters:
holder- the player
-
-
Method Details
-
getRawSlots
public int getRawSlots()Description copied from class:GlowInventoryGets the number of slots in this inventory according to the protocol.Some inventories have 0 slots in the protocol, despite having slots.
- Overrides:
getRawSlotsin classGlowInventory- Returns:
- The numbers of slots
-
getFirstItem
public org.bukkit.inventory.ItemStack getFirstItem()- Specified by:
getFirstItemin interfaceorg.bukkit.inventory.AnvilInventory
-
getSecondItem
public org.bukkit.inventory.ItemStack getSecondItem()- Specified by:
getSecondItemin interfaceorg.bukkit.inventory.AnvilInventory
-
getResultItem
public org.bukkit.inventory.ItemStack getResultItem() -
handleShiftClick
public void handleShiftClick(GlowPlayer player, org.bukkit.inventory.InventoryView view, int clickedSlot, org.bukkit.inventory.ItemStack clickedItem) Description copied from class:GlowInventoryHandle a shift click in this inventory by the specified player.The default implementation distributes items from the right to the left and from the bottom to the top.
- Overrides:
handleShiftClickin classGlowInventory- Parameters:
player- The player who clickedview- The inventory view in which was clickedclickedSlot- The slot in the viewclickedItem- The item at which was clicked
-
setItem
public void setItem(int index, org.bukkit.inventory.ItemStack item) - Specified by:
setItemin interfaceorg.bukkit.inventory.Inventory- Overrides:
setItemin classGlowInventory
-
getForged
public org.bukkit.inventory.ItemStack getForged()Returns the item that will result when this anvil is applied to the currently loaded items, combining them, provided that two items which can be combined are loaded. A return of null doesn't imply that the anvil cannot be activated, since it may still be able to repair/name a single item.- Returns:
- the resulting item, or null if two items that can be combined are not loaded
-
setRenameText
Sets the name of the next item to be modified on this anvil.- Parameters:
name- the item name
-
getRenameText
- Specified by:
getRenameTextin interfaceorg.bukkit.inventory.AnvilInventory
-
getRepairCost
public int getRepairCost()- Specified by:
getRepairCostin interfaceorg.bukkit.inventory.AnvilInventory
-
setRepairCost
public void setRepairCost(int repairCost) - Specified by:
setRepairCostin interfaceorg.bukkit.inventory.AnvilInventory
-
getMaximumRepairCost
public int getMaximumRepairCost()- Specified by:
getMaximumRepairCostin interfaceorg.bukkit.inventory.AnvilInventory
-
setMaximumRepairCost
public void setMaximumRepairCost(int maximumRepairCost) - Specified by:
setMaximumRepairCostin interfaceorg.bukkit.inventory.AnvilInventory
-