Class BlockRedstoneDiode

All Implemented Interfaces:
BlockID, IBlockState, IMutableBlockState, AxisAlignedBB, Metadatable, Faceable, RedstoneComponent, Cloneable
Direct Known Subclasses:
BlockRedstoneComparator, BlockRedstoneRepeater

@PowerNukkitDifference(info="Implements RedstoneComponent and uses methods from it.", since="1.4.0.0-PN") public abstract class BlockRedstoneDiode extends BlockFlowable implements RedstoneComponent, Faceable
Author:
CreeperFace
  • Field Details

    • isPowered

      protected boolean isPowered
  • Constructor Details

    • BlockRedstoneDiode

      public BlockRedstoneDiode()
    • BlockRedstoneDiode

      public BlockRedstoneDiode(int meta)
  • Method Details

    • getWaterloggingLevel

      @PowerNukkitOnly public int getWaterloggingLevel()
      Overrides:
      getWaterloggingLevel in class Block
    • canBeFlowedInto

      public boolean canBeFlowedInto()
      Overrides:
      canBeFlowedInto in class BlockFlowable
    • onBreak

      public boolean onBreak(Item item)
      Overrides:
      onBreak in class Block
    • place

      @PowerNukkitDifference(info="Allow to be placed on top of the walls",since="1.3.0.0-PN") @PowerNukkitDifference(since="1.4.0.0-PN",info="Fixed support logic") public boolean place(@Nonnull Item item, @Nonnull Block block, @Nonnull Block target, @Nonnull BlockFace face, double fx, double fy, double fz, Player player)
      Description copied from class: Block
      Place and initialize a this block correctly in the world.

      The current instance must have level, x, y, z, and layer properties already set before calling this method.

      Overrides:
      place in class Block
      Parameters:
      item - The item being used to place the block. Should be used as an optional reference, may mismatch the block that is being placed depending on plugin implementations.
      block - The current block that is in the world and is getting replaced by this instance. It has the same x, y, z, layer, and level as this block.
      target - The block that was clicked to create the place action in this block position.
      face - The face that was clicked in the target block
      fx - The detailed X coordinate of the clicked target block face
      fy - The detailed Y coordinate of the clicked target block face
      fz - The detailed Z coordinate of the clicked target block face
      player - The player that is placing the block. May be null.
      Returns:
      true if the block was properly place. The implementation is responsible for reverting any partial change.
    • isSupportValid

      @PowerNukkitOnly protected boolean isSupportValid(Block support)
    • onUpdate

      @PowerNukkitDifference(info="Allow to be placed on top of the walls",since="1.3.0.0-PN") @PowerNukkitDifference(since="1.4.0.0-PN",info="Fixed support logic") public int onUpdate(int type)
      Overrides:
      onUpdate in class Block
    • updateState

      public void updateState()
    • isLocked

      public boolean isLocked()
    • calculateInputStrength

      protected int calculateInputStrength()
    • getPowerOnSides

      protected int getPowerOnSides()
    • getPowerOnSide

      protected int getPowerOnSide(Vector3 pos, BlockFace side)
    • isPowerSource

      public boolean isPowerSource()
      Overrides:
      isPowerSource in class Block
    • shouldBePowered

      protected boolean shouldBePowered()
    • getFacing

      public abstract BlockFace getFacing()
    • getDelay

      protected abstract int getDelay()
    • getUnpowered

      protected abstract Block getUnpowered()
    • getPowered

      protected abstract Block getPowered()
    • getMaxY

      public double getMaxY()
      Specified by:
      getMaxY in interface AxisAlignedBB
      Overrides:
      getMaxY in class Block
    • canPassThrough

      public boolean canPassThrough()
      Overrides:
      canPassThrough in class BlockFlowable
    • isAlternateInput

      protected boolean isAlternateInput(Block block)
    • isDiode

      public static boolean isDiode(Block block)
    • getRedstoneSignal

      protected int getRedstoneSignal()
    • getStrongPower

      public int getStrongPower(BlockFace side)
      Overrides:
      getStrongPower in class Block
    • getWeakPower

      public int getWeakPower(BlockFace side)
      Overrides:
      getWeakPower in class Block
    • canBeActivated

      public boolean canBeActivated()
      Overrides:
      canBeActivated in class Block
    • isPowered

      public boolean isPowered()
    • isFacingTowardsRepeater

      public boolean isFacingTowardsRepeater()
    • recalculateBoundingBox

      protected AxisAlignedBB recalculateBoundingBox()
      Overrides:
      recalculateBoundingBox in class BlockFlowable
    • getBlockFace

      public BlockFace getBlockFace()
      Specified by:
      getBlockFace in interface Faceable
    • getColor

      public BlockColor getColor()
      Overrides:
      getColor in class BlockTransparentMeta