Class PoweredBlock

All Implemented Interfaces:
FeatureElement, ItemLike, IBlockExtension

public class PoweredBlock extends Block
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<PoweredBlock> CODEC
  • Constructor Details

  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<PoweredBlock> codec()
      Overrides:
      codec in class Block
    • isSignalSource

      protected boolean isSignalSource(BlockState pState)
      Returns whether this block is capable of emitting redstone signals.
      Overrides:
      isSignalSource in class BlockBehaviour
    • getSignal

      protected int getSignal(BlockState pBlockState, BlockGetter pBlockAccess, BlockPos pPos, Direction pSide)
      Returns the signal this block emits in the given direction.

      NOTE: directions in redstone signal related methods are backwards, so this method checks for the signal emitted in the opposite direction of the one given.

      Overrides:
      getSignal in class BlockBehaviour