Class RedstoneTorchPart

All Implemented Interfaces:
AnimateTickPart, FacePart, IconHitEffectsPart, ModelRenderPart, MultiPart, NormalOcclusionPart, RandomTickPart, FaceRedstonePart, RedstonePart, SlottedPart

public class RedstoneTorchPart extends TorchPart implements FaceRedstonePart, RandomTickPart
  • Constructor Details

    • RedstoneTorchPart

      public RedstoneTorchPart()
    • RedstoneTorchPart

      public RedstoneTorchPart(net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • getType

      public MultipartType<?> getType()
      Description copied from interface: MultiPart
      Returns the MultipartType registry entry for this part.
      Specified by:
      getType in interface MultiPart
      Overrides:
      getType in class TorchPart
      Returns:
      The MultipartType.
      See Also:
    • getStandingBlock

      protected net.minecraft.world.level.block.Block getStandingBlock()
      Overrides:
      getStandingBlock in class TorchPart
    • getWallBlock

      protected net.minecraft.world.level.block.Block getWallBlock()
      Overrides:
      getWallBlock in class TorchPart
    • active

      public boolean active()
    • animateTick

      public void animateTick(net.minecraft.util.RandomSource random)
      Specified by:
      animateTick in interface AnimateTickPart
      Overrides:
      animateTick in class TorchPart
    • onNeighborBlockChanged

      public void onNeighborBlockChanged(net.minecraft.core.BlockPos from)
      Description copied from interface: MultiPart
      Called when a neighbor block changes.
      Specified by:
      onNeighborBlockChanged in interface MultiPart
      Overrides:
      onNeighborBlockChanged in class McSidedStatePart
      Parameters:
      from - The neighbor block.
    • isBeingPowered

      public boolean isBeingPowered()
    • scheduledTick

      public void scheduledTick()
      Description copied from interface: MultiPart
      Called when a scheduled tick is executed.
      Specified by:
      scheduledTick in interface MultiPart
      See Also:
    • randomTick

      public void randomTick()
      Description copied from interface: RandomTickPart
      Called on random update.

      Random ticks are between 800 and 1600 ticks from their last scheduled/random tick.

      Specified by:
      randomTick in interface RandomTickPart
    • onChunkLoad

      public void onChunkLoad(net.minecraft.world.level.chunk.LevelChunk chunk)
      Description copied from interface: MultiPart
      Called when the containing chunk is loaded on the server.
      Specified by:
      onChunkLoad in interface MultiPart
      Specified by:
      onChunkLoad in interface RandomTickPart
      Parameters:
      chunk - The chunk.
    • onWorldJoin

      public void onWorldJoin()
      Description copied from interface: MultiPart
      Called when this part joins the world.

      This may be due to placement, chunk load, frames, etc.

      Use this to sync with external data structures.

      Called client and server side.

      Specified by:
      onWorldJoin in interface MultiPart
      Specified by:
      onWorldJoin in interface RandomTickPart
    • onRemoved

      public void onRemoved()
      Description copied from interface: MultiPart
      Called when this part is removed from the block space.
      Specified by:
      onRemoved in interface MultiPart
    • onAdded

      public void onAdded()
      Description copied from interface: MultiPart
      Called when this part is added to the block space.
      Specified by:
      onAdded in interface MultiPart
    • strongPowerLevel

      public int strongPowerLevel(int side)
      Description copied from interface: RedstonePart
      Returns the strong (indirect, through blocks) signal being emitted by this part on the specified side.
      Specified by:
      strongPowerLevel in interface RedstonePart
      Parameters:
      side - The side index.
      Returns:
      The redstone signal.
    • weakPowerLevel

      public int weakPowerLevel(int side)
      Description copied from interface: RedstonePart
      Returns the weak (direct) being emitted by this part on the specified side.
      Specified by:
      weakPowerLevel in interface RedstonePart
      Parameters:
      side - The side index.
      Returns:
      The redstone signal.
    • canConnectRedstone

      public boolean canConnectRedstone(int side)
      Description copied from interface: RedstonePart
      Returns weather this part can connect to redstone on the specified side.

      Blocking parts like covers will be handled by RedstoneInteractions.

      Specified by:
      canConnectRedstone in interface RedstonePart
      Parameters:
      side - The side index.
      Returns:
      True if redstone can connect.
    • getFace

      public int getFace()
      Description copied from interface: FaceRedstonePart
      Returns the face which this Redstone part is attached.
      Specified by:
      getFace in interface FaceRedstonePart
      Returns:
      The face.