Interface ICrankable


public interface ICrankable
Crank/Crankable API,

Blocks that expose this interface via Api lookup can receive power from the crank. A block can return this interface only on specific sides to control where it can attach to.

Cranks obtain this interface from a block using a Forge capability.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The crank has completed one turn on the given side.
    boolean
    Test if the crank can turn, return false if there is no work to be done.
    static @Nullable ICrankable
    get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)
     
  • Method Details

    • canTurn

      boolean canTurn()
      Test if the crank can turn, return false if there is no work to be done.
      Returns:
      if crank should be allowed to turn on the given side.
    • applyTurn

      void applyTurn()
      The crank has completed one turn on the given side.
    • get

      @Nullable static @Nullable ICrankable get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side)