Interface Levelled

All Superinterfaces:
BlockData

public interface Levelled extends BlockData
A block state carrying the level property: the fill level of fluids, cauldrons and similar blocks.

Block states are immutable: with... methods return another state and leave this one untouched.

Since:
0.1.0
  • Method Details

    • getLevel

      default int getLevel()
      Returns the current level, from 0 to getMaximumLevel().
      Returns:
      the current level, from 0 to getMaximumLevel()
      Since:
      0.1.0
    • withLevel

      default Levelled withLevel(int level)
      Returns the same block with another level value.
      Parameters:
      level - the level
      Returns:
      the same block with another level value
      Since:
      0.1.0
    • getMaximumLevel

      default int getMaximumLevel()
      Returns the highest level of this block.
      Returns:
      the highest level of this block
      Throws:
      IllegalStateException - if the block type declares no level property
      Since:
      0.1.0