Class LeverPart

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

public class LeverPart extends McSidedStatePart implements FaceRedstonePart
  • Constructor Details

    • LeverPart

      public LeverPart()
    • LeverPart

      public LeverPart(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
      Returns:
      The MultipartType.
      See Also:
    • defaultBlockState

      public net.minecraft.world.level.block.state.BlockState defaultBlockState()
      Specified by:
      defaultBlockState in class McStatePart
    • getDropStack

      public net.minecraft.world.item.ItemStack getDropStack()
      Specified by:
      getDropStack in class McStatePart
    • active

      public boolean active()
    • getSide

      public net.minecraft.core.Direction getSide()
      Specified by:
      getSide in class McSidedStatePart
    • setStateOnPlacement

      @Nullable public @Nullable MultiPart setStateOnPlacement(net.minecraft.world.item.context.BlockPlaceContext context)
      Overrides:
      setStateOnPlacement in class McStatePart
    • useWithoutItem

      public net.minecraft.world.InteractionResult useWithoutItem(net.minecraft.world.entity.player.Player player, PartRayTraceResult hit)
      Description copied from interface: MultiPart
      Called on block right-click without an item.

      This should not modify the part client-side.

      Specified by:
      useWithoutItem in interface MultiPart
      Parameters:
      player - The player that right-clicked the part.
      hit - The PartRayTraceResult hit result.
      Returns:
      The InteractionResult.
    • 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
    • onConverted

      public void onConverted()
      Description copied from interface: MultiPart
      Called when this part is converted from a normal block or tile.

      Only applicable if a converter has been registered.

      Specified by:
      onConverted in interface MultiPart
      See Also:
    • 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.
    • 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.
    • 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.
    • readUpdate

      public void readUpdate(codechicken.lib.data.MCDataInput packet)
      Description copied from interface: MultiPart
      Specified by:
      readUpdate in interface MultiPart
      Parameters:
      packet - THe packet to read.