Class BlockRedstoneEvent


@NullMarked public class BlockRedstoneEvent extends BlockEvent
Called when a redstone current changes.

It includes the relevant mutation of the powered and power properties even if the block is not able to produce a redstone signal. For the powered property, a high state will be considered as a current of 15 and a low state as 0. Setting the new current to a different value will prevent most action in this case.

  • Constructor Details

    • BlockRedstoneEvent

      @Internal public BlockRedstoneEvent(Block block, int oldCurrent, int newCurrent)
  • Method Details

    • getOldCurrent

      public @IntRange(from=0L,to=15L) int getOldCurrent()
      Gets the old current of this block.
      Returns:
      the previous current
    • getNewCurrent

      public @IntRange(from=0L,to=15L) int getNewCurrent()
      Gets the new current of this block.
      Returns:
      the new current
    • setNewCurrent

      public void setNewCurrent(@IntRange(from=0L,to=15L) int newCurrent)
      Sets the new current of this block.
      Parameters:
      newCurrent - the new current to set
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()