Class MovementHelper

java.lang.Object
com.zenith.feature.pathfinder.movement.MovementHelper

public final class MovementHelper extends Object
  • Method Details

    • avoidBreaking

      public static boolean avoidBreaking(int x, int y, int z, int state)
    • avoidAdjacentBreaking

      public static boolean avoidAdjacentBreaking(int x, int y, int z, boolean directlyAbove, boolean directlyBelow)
    • canWalkThrough

      public static boolean canWalkThrough(BlockPos pos)
    • canWalkThrough

      public static boolean canWalkThrough(int x, int y, int z)
    • canWalkThrough

      public static boolean canWalkThrough(CalculationContext context, int x, int y, int z, int state)
    • canWalkThrough

      public static boolean canWalkThrough(CalculationContext context, int x, int y, int z)
    • canWalkThrough

      public static boolean canWalkThrough(int x, int y, int z, int blockStateId)
    • canWalkThroughBlockState

      public static Ternary canWalkThroughBlockState(int blockStateId)
    • canWalkThroughPosition

      public static boolean canWalkThroughPosition(int x, int y, int z, int blockStateId)
    • fullyPassableBlockState

      public static boolean fullyPassableBlockState(int state)
    • fullyPassable

      public static boolean fullyPassable(CalculationContext context, int x, int y, int z)
      canWalkThrough but also won't impede movement at all. so not including doors or fence gates (we'd have to right click), not including water, and not including ladders or vines or cobwebs (they slow us down)
    • fullyPassable

      public static boolean fullyPassable(CalculationContext context, int x, int y, int z, int blockStateId)
    • fullyPassable

      public static boolean fullyPassable(BlockPos pos)
    • isReplaceable

      public static boolean isReplaceable(int x, int z, int blockStateId)
    • isDoorPassable

      public static boolean isDoorPassable(BlockPos doorPos, BlockPos playerPos)
    • isGatePassable

      public static boolean isGatePassable(BlockPos gatePos, BlockPos playerPos)
    • avoidWalkingInto

      public static boolean avoidWalkingInto(Block block)
    • canWalkOn

      public static boolean canWalkOn(int x, int y, int z, int blockStateId)
      Can I walk on this block without anything weird happening like me falling through? Includes water because we know that we automatically jump on water

      If changing something in this function remember to also change it in precomputed data

      Parameters:
      x - The block's x position
      y - The block's y position
      z - The block's z position
      Returns:
      Whether or not the specified block can be walked on
    • canWalkOnBlockState

      public static Ternary canWalkOnBlockState(int blockStateId)
    • canWalkOnPosition

      public static boolean canWalkOnPosition(int x, int y, int z, int blockStateId)
    • canWalkOn

      public static boolean canWalkOn(CalculationContext context, int x, int y, int z, int blockStateId)
    • canWalkOn

      public static boolean canWalkOn(CalculationContext context, int x, int y, int z)
    • canWalkOn

      public static boolean canWalkOn(BlockPos pos, int state)
    • canWalkOn

      public static boolean canWalkOn(BlockPos pos)
    • canWalkOn

      public static boolean canWalkOn(int x, int y, int z)
    • canUseFrostWalker

      public static boolean canUseFrostWalker(CalculationContext context, int blockStateId)
    • canUseFrostWalker

      public static boolean canUseFrostWalker(PlayerContext ctx, BlockPos pos)
    • mustBeSolidToWalkOn

      public static boolean mustBeSolidToWalkOn(CalculationContext context, int x, int y, int z, int blockStateId)
      If movements make us stand/walk on this block, will it have a top to walk on?
    • canPlaceAgainst

      public static boolean canPlaceAgainst(int x, int y, int z)
    • canPlaceAgainst

      public static boolean canPlaceAgainst(BlockPos pos)
    • canPlaceAgainst

      public static boolean canPlaceAgainst(int blockStateId)
    • getMiningDurationTicks

      public static double getMiningDurationTicks(CalculationContext context, int x, int y, int z, boolean includeFalling)
    • getMiningDurationTicks

      public static double getMiningDurationTicks(CalculationContext context, int x, int y, int z, int blockStateId, boolean includeFalling)
    • switchToBestToolFor

      public static void switchToBestToolFor(Block b)
      AutoTool for a specific block
      Parameters:
      b - the blockstate to mine
    • switchToBestToolFor

      public static void switchToBestToolFor(Block b, ToolSet ts, boolean preferSilkTouch)
      AutoTool for a specific block with precomputed ToolSet data
    • moveTowards

      public static void moveTowards(MovementState state, BlockPos pos)
    • moveToBlockCenter

      public static void moveToBlockCenter(MovementState state, PlayerContext ctx, BlockPos pos)
    • safeJump

      public static void safeJump(MovementState state, PlayerContext ctx)
    • centerSideways

      public static void centerSideways(MovementState state, PlayerContext ctx, BlockPos src, BlockPos dest)
    • isWater

      public static boolean isWater(Block block)
      Returns whether or not the specified block is water, regardless of whether or not it is flowing.
    • isWater

      public static boolean isWater(BlockPos bp)
      Returns whether or not the block at the specified pos is water, regardless of whether or not it is flowing.
      Parameters:
      bp - The block pos
      Returns:
      Whether or not the block is water
    • isLava

      public static boolean isLava(Block block)
    • isLiquid

      public static boolean isLiquid(BlockPos p)
      Returns whether or not the specified pos has a liquid
      Parameters:
      p - The pos
      Returns:
      Whether or not the block is a liquid
    • isLiquid

      public static boolean isLiquid(Block block)
    • isPlayerTouchingWater

      public static boolean isPlayerTouchingWater()
    • isPlayerTouchingLava

      public static boolean isPlayerTouchingLava()
    • isPlayerTouchingLiquid

      public static boolean isPlayerTouchingLiquid()
    • isFlowing

      public static boolean isFlowing(int x, int y, int z)
    • isBlockNormalCube

      public static boolean isBlockNormalCube(int blockStateId)
    • attemptToPlaceABlock

      public static MovementHelper.PlaceResult attemptToPlaceABlock(MovementState state, BlockPos placeAt, boolean preferDown, boolean wouldSneak)