Interface AnaloguePowerable

All Superinterfaces:
BlockData
All Known Subinterfaces:
RedstoneWire

@BlockTrait(properties="power") public interface AnaloguePowerable extends BlockData
A block state carrying the power property: the strength of the redstone signal the block carries or emits, like redstone dust, a weighted pressure plate or a daylight detector. Blocks that are only on or off are Powerable instead.

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

Since:
0.1.0
  • Method Details

    • getPower

      default int getPower()
      Returns the signal strength, from 0 to getMaximumPower().
      Returns:
      the signal strength, from 0 to getMaximumPower()
      Since:
      0.1.0
    • withPower

      default AnaloguePowerable withPower(int power)
      Returns the same block with another power value.
      Parameters:
      power - the signal strength
      Returns:
      the same block with another power value
      Throws:
      IllegalArgumentException - if the block does not accept that strength
      Since:
      0.1.0
    • getMaximumPower

      default int getMaximumPower()
      Returns the highest signal strength of this block.
      Returns:
      the highest signal strength of this block
      Throws:
      IllegalStateException - if the block type declares no power property
      Since:
      0.1.0