Interface ChiseledBookshelf

All Superinterfaces:
BlockInventoryHolder, BlockState, InventoryHolder, Metadatable, PersistentDataHolder, PersistentDataViewHolder, TileState, TileStateInventoryHolder

public interface ChiseledBookshelf extends TileStateInventoryHolder
Represents a captured state of a chiseled bookshelf.
  • Method Details

    • getLastInteractedSlot

      int getLastInteractedSlot()
      Gets the last interacted inventory slot.
      Returns:
      the last interacted slot
    • setLastInteractedSlot

      void setLastInteractedSlot(int lastInteractedSlot)
      Sets the last interacted inventory slot.
      Parameters:
      lastInteractedSlot - the new last interacted slot
    • getInventory

      Description copied from interface: TileStateInventoryHolder
      Gets the inventory of the block represented by this block state.

      If the block was changed to a different type in the meantime, the returned inventory might no longer be valid.

      If this block state is not placed this will return the captured inventory snapshot instead.

      Specified by:
      getInventory in interface InventoryHolder
      Specified by:
      getInventory in interface TileStateInventoryHolder
      Returns:
      the inventory
    • getSnapshotInventory

      Description copied from interface: TileStateInventoryHolder
      Gets the captured inventory snapshot of this container.

      The returned inventory is not linked to any block. Any modifications to the returned inventory will not be applied to the block represented by this block state up until BlockState.update(boolean, boolean) has been called.

      Specified by:
      getSnapshotInventory in interface TileStateInventoryHolder
      Returns:
      the captured inventory snapshot
    • getSlot

      int getSlot(@NotNull @NotNull Vector position)
      Gets the appropriate slot based on a vector relative to this block.
      Will return -1 if the given vector is not within the bounds of any slot.

      The supplied vector should only contain components with values between 0.0 and 1.0, inclusive.

      Parameters:
      position - a vector relative to this block
      Returns:
      the slot under the given vector or -1