Interface RedstoneOutputEvent
- All Superinterfaces:
Cancellable, Event, RedstoneEvent
Fired when a redstone component is about to change the signal it emits: a lever pulled, a button
pressed or popping back out, a torch turning on or off, a repeater or a comparator switching, an
observer pulsing.
The signals are those the component emits towards the blocks it powers: 15 or 0
for most components, the level it outputs for a comparator.
Cancelling the event keeps the component as it is, and the blocks around it are not told anything changed. A lever stays where it was. A button is not pressed, or, popping back out, stays pressed and tries again once its delay has elapsed once more; an observer ending its pulse tries again two game ticks later. A repeater, a comparator or a torch tries again when one of its neighbours next changes.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the signal the component is about to emit, from0to15.intReturns the signal the component emits, from0to15.default booleanReturnstrueif the component is turning off: it emits a signal and is about to stop.default booleanReturnstrueif the component is turning on: it emits no signal and is about to emit one.Methods inherited from interface Cancellable
isCancelled, setCancelledMethods inherited from interface RedstoneEvent
block, position, world
-
Method Details
-
oldSignal
int oldSignal()Returns the signal the component emits, from0to15.- Returns:
- the signal the component emits, from
0to15 - Since:
- 0.1.0
-
newSignal
int newSignal()Returns the signal the component is about to emit, from0to15.- Returns:
- the signal the component is about to emit, from
0to15 - Since:
- 0.1.0
-
turningOn
default boolean turningOn()Returnstrueif the component is turning on: it emits no signal and is about to emit one.- Returns:
trueif the component is turning on: it emits no signal and is about to emit one- Since:
- 0.1.0
-
turningOff
default boolean turningOff()Returnstrueif the component is turning off: it emits a signal and is about to stop.- Returns:
trueif the component is turning off: it emits a signal and is about to stop- Since:
- 0.1.0
-