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 Summary
Modifier and TypeMethodDescriptionstatic Mirror
<EnderChestSlot> The default mirror which assigns each slot to its default index.static Mirror
<PlayerInventorySlot> The default mirror which assigns each slot to its default index.static Mirror
<EnderChestSlot> forEnderChest
(String template) Convert a template into a Mirror.static Mirror
<PlayerInventorySlot> forInventory
(String template) Convert a template into a Mirror.Gets the index for the grid in which the slot is displayed.getSlot
(int index) Get the slot for the index at which the slot is displayed.static String
toEnderChestTemplate
(Mirror<EnderChestSlot> mirror) Convert a Mirror into a template.static String
toInventoryTemplate
(Mirror<PlayerInventorySlot> mirror) Convert a Mirror into a template.
-
Method Details
-
getIndex
-
getSlot
Get the slot for the index at which the slot is displayed. This method must satisfy the equationObjects.equals(slot, getSlot(getIndex(slot)))
. -
defaultPlayerInventory
The default mirror which assigns each slot to its default index. -
defaultEnderChest
The default mirror which assigns each slot to its default index. -
forInventory
Convert a template into a Mirror. -
forEnderChest
Convert a template into a Mirror. -
toInventoryTemplate
Convert a Mirror into a template. -
toEnderChestTemplate
Convert a Mirror into a template.
-