Interface AnaloguePowerable
- All Superinterfaces:
BlockData
- All Known Subinterfaces:
RedstoneWire
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 Summary
Modifier and TypeMethodDescriptiondefault intReturns the highest signal strength of this block.default intgetPower()Returns the signal strength, from0togetMaximumPower().default AnaloguePowerablewithPower(int power) Returns the same block with anotherpowervalue.
-
Method Details
-
getPower
default int getPower()Returns the signal strength, from0togetMaximumPower().- Returns:
- the signal strength, from
0togetMaximumPower() - Since:
- 0.1.0
-
withPower
Returns the same block with anotherpowervalue.- Parameters:
power- the signal strength- Returns:
- the same block with another
powervalue - 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 nopowerproperty- Since:
- 0.1.0
-