Class MovementHelper
java.lang.Object
com.zenith.feature.pathfinder.movement.MovementHelper
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic MovementHelper.PlaceResultattemptToPlaceABlock(MovementState state, BlockPos placeAt, boolean preferDown, boolean wouldSneak) static booleanavoidAdjacentBreaking(int x, int y, int z, boolean directlyAbove, boolean directlyBelow) static booleanavoidBreaking(int x, int y, int z, int state) static booleanavoidWalkingInto(Block block) static booleancanPlaceAgainst(int blockStateId) static booleancanPlaceAgainst(int x, int y, int z) static booleancanPlaceAgainst(BlockPos pos) static booleancanUseFrostWalker(CalculationContext context, int blockStateId) static booleancanUseFrostWalker(PlayerContext ctx, BlockPos pos) static booleancanWalkOn(int x, int y, int z) static booleancanWalkOn(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 waterstatic booleancanWalkOn(CalculationContext context, int x, int y, int z) static booleancanWalkOn(CalculationContext context, int x, int y, int z, int blockStateId) static booleanstatic booleanstatic TernarycanWalkOnBlockState(int blockStateId) static booleancanWalkOnPosition(int x, int y, int z, int blockStateId) static booleancanWalkThrough(int x, int y, int z) static booleancanWalkThrough(int x, int y, int z, int blockStateId) static booleancanWalkThrough(CalculationContext context, int x, int y, int z) static booleancanWalkThrough(CalculationContext context, int x, int y, int z, int state) static booleancanWalkThrough(BlockPos pos) static TernarycanWalkThroughBlockState(int blockStateId) static booleancanWalkThroughPosition(int x, int y, int z, int blockStateId) static voidcenterSideways(MovementState state, PlayerContext ctx, BlockPos src, BlockPos dest) static booleanfullyPassable(CalculationContext context, int x, int y, int z) canWalkThrough but also won't impede movement at all.static booleanfullyPassable(CalculationContext context, int x, int y, int z, int blockStateId) static booleanfullyPassable(BlockPos pos) static booleanfullyPassableBlockState(int state) static doublegetMiningDurationTicks(CalculationContext context, int x, int y, int z, boolean includeFalling) static doublegetMiningDurationTicks(CalculationContext context, int x, int y, int z, int blockStateId, boolean includeFalling) static booleanisBlockNormalCube(int blockStateId) static booleanisDoorPassable(BlockPos doorPos, BlockPos playerPos) static booleanisFlowing(int x, int y, int z) static booleanisGatePassable(BlockPos gatePos, BlockPos playerPos) static booleanstatic booleanstatic booleanReturns whether or not the specified pos has a liquidstatic booleanisReplaceable(int x, int z, int blockStateId) static booleanReturns whether or not the specified block is water, regardless of whether or not it is flowing.static booleanReturns whether or not the block at the specified pos is water, regardless of whether or not it is flowing.static voidmoveToBlockCenter(MovementState state, PlayerContext ctx, BlockPos pos) static voidmoveTowards(MovementState state, BlockPos pos) static booleanmustBeSolidToWalkOn(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?static voidsafeJump(MovementState state, PlayerContext ctx) static voidAutoTool for a specific blockstatic voidswitchToBestToolFor(Block b, ToolSet ts, boolean preferSilkTouch) AutoTool for a specific block with precomputed ToolSet data
-
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
-
canWalkThrough
public static boolean canWalkThrough(int x, int y, int z) -
canWalkThrough
-
canWalkThrough
-
canWalkThrough
public static boolean canWalkThrough(int x, int y, int z, int blockStateId) -
canWalkThroughBlockState
-
canWalkThroughPosition
public static boolean canWalkThroughPosition(int x, int y, int z, int blockStateId) -
fullyPassableBlockState
public static boolean fullyPassableBlockState(int state) -
fullyPassable
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
-
isReplaceable
public static boolean isReplaceable(int x, int z, int blockStateId) -
isDoorPassable
-
isGatePassable
-
avoidWalkingInto
-
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 waterIf changing something in this function remember to also change it in precomputed data
- Parameters:
x- The block's x positiony- The block's y positionz- The block's z position- Returns:
- Whether or not the specified block can be walked on
-
canWalkOnBlockState
-
canWalkOnPosition
public static boolean canWalkOnPosition(int x, int y, int z, int blockStateId) -
canWalkOn
-
canWalkOn
-
canWalkOn
-
canWalkOn
-
canWalkOn
public static boolean canWalkOn(int x, int y, int z) -
canUseFrostWalker
-
canUseFrostWalker
-
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
-
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
AutoTool for a specific block- Parameters:
b- the blockstate to mine
-
switchToBestToolFor
-
moveTowards
-
moveToBlockCenter
-
safeJump
-
centerSideways
public static void centerSideways(MovementState state, PlayerContext ctx, BlockPos src, BlockPos dest) -
isWater
Returns whether or not the specified block is water, regardless of whether or not it is flowing. -
isWater
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
-
isLiquid
Returns whether or not the specified pos has a liquid- Parameters:
p- The pos- Returns:
- Whether or not the block is a liquid
-
isLiquid
-
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)
-