Interface HopperInventory

All Superinterfaces:
BlockInventory, Container

public interface HopperInventory extends BlockInventory
The 5 slots of a hopper, read from and written to its block entity as BlockInventory tells.

Once its cooldown is over, an enabled hopper pushes items into the container it faces, then pulls items from the container above it, and waits again the cooldown the configuration of its world gives after either one. With no container above it, it also picks up the items lying in its bowl, and those lying above it unless a full block covers it, without waiting for its cooldown nor starting it.

Since:
0.1.0
See Also:
  • Field Details

    • SIZE

      static final int SIZE
      The number of slots of a hopper.
      Since:
      0.1.0
      See Also:
  • Method Details

    • transferCooldown

      int transferCooldown()
      Returns the game ticks left before the hopper moves items again, 0 when it is ready.

      A hopper only counts its cooldown down while its region ticks.

      Returns:
      the game ticks left before the hopper moves items again, 0 when it is ready
      Since:
      0.1.0
    • setTransferCooldown

      void setTransferCooldown(int ticks)
      Makes the hopper wait before moving items again, or lets it move them on its next tick.
      Parameters:
      ticks - the game ticks to wait, 0 to move items on the next tick
      Throws:
      IllegalArgumentException - if ticks is negative
      Since:
      0.1.0