Interface Mirror<Slot>

Type Parameters:
Slot - type of slot that this mirror works on
All Known Implementing Classes:
EnderChestMirror, PlayerInventoryMirror

public interface Mirror<Slot>
Represents a mirror that an inventory is viewed through. Mirrors provide the power change the positions of slots in the grid window. Hence, Mirrors only affect how players see the SpectatorInventory, they don't change the outcome of Inventory.getItem(int) and related methods.
See Also:
  • Method Details Link icon

    • getIndex Link icon

      Integer getIndex(Slot slot)
      Gets the index for the grid in which the slot is displayed. This method must satisfy the equation Objects.equals(index, getIndex(getSlot(index))).s
    • getSlot Link icon

      Slot getSlot(int index)
      Get the slot for the index at which the slot is displayed. This method must satisfy the equation Objects.equals(slot, getSlot(getIndex(slot))).
    • defaultPlayerInventory Link icon

      static Mirror<PlayerInventorySlot> defaultPlayerInventory()
      The default mirror which assigns each slot to its default index.
    • defaultEnderChest Link icon

      static Mirror<EnderChestSlot> defaultEnderChest()
      The default mirror which assigns each slot to its default index.
    • forInventory Link icon

      static Mirror<PlayerInventorySlot> forInventory(String template)
      Convert a template into a Mirror.
    • forEnderChest Link icon

      static Mirror<EnderChestSlot> forEnderChest(String template)
      Convert a template into a Mirror.
    • toInventoryTemplate Link icon

      static String toInventoryTemplate(Mirror<PlayerInventorySlot> mirror)
      Convert a Mirror into a template.
    • toEnderChestTemplate Link icon

      static String toEnderChestTemplate(Mirror<EnderChestSlot> mirror)
      Convert a Mirror into a template.