Interface RedstoneOutputEvent

All Superinterfaces:
Cancellable, Event, RedstoneEvent

public interface RedstoneOutputEvent extends RedstoneEvent, Cancellable
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 Type
    Method
    Description
    int
    Returns the signal the component is about to emit, from 0 to 15.
    int
    Returns the signal the component emits, from 0 to 15.
    default boolean
    Returns true if the component is turning off: it emits a signal and is about to stop.
    default boolean
    Returns true if the component is turning on: it emits no signal and is about to emit one.

    Methods inherited from interface Cancellable

    isCancelled, setCancelled

    Methods inherited from interface RedstoneEvent

    block, position, world
  • Method Details

    • oldSignal

      int oldSignal()
      Returns the signal the component emits, from 0 to 15.
      Returns:
      the signal the component emits, from 0 to 15
      Since:
      0.1.0
    • newSignal

      int newSignal()
      Returns the signal the component is about to emit, from 0 to 15.
      Returns:
      the signal the component is about to emit, from 0 to 15
      Since:
      0.1.0
    • turningOn

      default boolean turningOn()
      Returns true if the component is turning on: it emits no signal and is about to emit one.
      Returns:
      true if the component is turning on: it emits no signal and is about to emit one
      Since:
      0.1.0
    • turningOff

      default boolean turningOff()
      Returns true if the component is turning off: it emits a signal and is about to stop.
      Returns:
      true if the component is turning off: it emits a signal and is about to stop
      Since:
      0.1.0