Interface Ageable

All Superinterfaces:
BlockData

public interface Ageable extends BlockData
A block state carrying the age property: the growth stage of crops and similar blocks.

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

Since:
0.1.0
  • Method Details

    • getAge

      default int getAge()
      Returns the current growth stage, from 0 to getMaximumAge().
      Returns:
      the current growth stage, from 0 to getMaximumAge()
      Since:
      0.1.0
    • withAge

      default Ageable withAge(int age)
      Returns the same block with another age value.
      Parameters:
      age - the growth stage
      Returns:
      the same block with another age value
      Since:
      0.1.0
    • getMaximumAge

      default int getMaximumAge()
      Returns the last growth stage of this block.
      Returns:
      the last growth stage of this block
      Throws:
      IllegalStateException - if the block type declares no age property
      Since:
      0.1.0