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 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: GlowInventory
      Gets the number of slots in this inventory according to the protocol.

      Some inventories have 0 slots in the protocol, despite having slots.

      Overrides:
      getRawSlots in class GlowInventory
      Returns:
      The numbers of slots
    • getFirstItem

      public org.bukkit.inventory.ItemStack getFirstItem()
      Specified by:
      getFirstItem in interface org.bukkit.inventory.AnvilInventory
    • getSecondItem

      public org.bukkit.inventory.ItemStack getSecondItem()
      Specified by:
      getSecondItem in interface org.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: GlowInventory
      Handle 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:
      handleShiftClick in class GlowInventory
      Parameters:
      player - The player who clicked
      view - The inventory view in which was clicked
      clickedSlot - The slot in the view
      clickedItem - The item at which was clicked
    • setItem

      public void setItem(int index, org.bukkit.inventory.ItemStack item)
      Specified by:
      setItem in interface org.bukkit.inventory.Inventory
      Overrides:
      setItem in class GlowInventory
    • 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

      public void setRenameText(String name)
      Sets the name of the next item to be modified on this anvil.
      Parameters:
      name - the item name
    • getRenameText

      public String getRenameText()
      Specified by:
      getRenameText in interface org.bukkit.inventory.AnvilInventory
    • getRepairCost

      public int getRepairCost()
      Specified by:
      getRepairCost in interface org.bukkit.inventory.AnvilInventory
    • setRepairCost

      public void setRepairCost(int repairCost)
      Specified by:
      setRepairCost in interface org.bukkit.inventory.AnvilInventory
    • getMaximumRepairCost

      public int getMaximumRepairCost()
      Specified by:
      getMaximumRepairCost in interface org.bukkit.inventory.AnvilInventory
    • setMaximumRepairCost

      public void setMaximumRepairCost(int maximumRepairCost)
      Specified by:
      setMaximumRepairCost in interface org.bukkit.inventory.AnvilInventory