Class ActionCosts
java.lang.Object
com.zenith.feature.pathfinder.movement.ActionCosts
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleTo walk the rest of the way to be centered on the new blockstatic final doubledon't make this Double.MAX_VALUE because it's added to other things, maybe other COST_INFs, and that would make it overflow to negativestatic final doublestatic final doublestatic final double[]static final doubleWhen you hit space, you get enough upward velocity to go 1.25 blocks Then, you fall the remaining 0.25 to get on the surface, on block higher.static final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doubleTo walk off an edge you need to walk 0.5 to the edge then 0.3 to start falling offstatic final doubleThese costs are measured roughly in ticks btwstatic final doublestatic final double -
Method Summary
-
Field Details
-
WALK_ONE_BLOCK_COST
public static final double WALK_ONE_BLOCK_COSTThese costs are measured roughly in ticks btw- See Also:
-
WALK_ONE_IN_WATER_COST
public static final double WALK_ONE_IN_WATER_COST- See Also:
-
WALK_ONE_OVER_SOUL_SAND_COST
public static final double WALK_ONE_OVER_SOUL_SAND_COST- See Also:
-
LADDER_UP_ONE_COST
public static final double LADDER_UP_ONE_COST- See Also:
-
LADDER_DOWN_ONE_COST
public static final double LADDER_DOWN_ONE_COST- See Also:
-
SNEAK_ONE_BLOCK_COST
public static final double SNEAK_ONE_BLOCK_COST- See Also:
-
SPRINT_ONE_BLOCK_COST
public static final double SPRINT_ONE_BLOCK_COST- See Also:
-
SPRINT_MULTIPLIER
public static final double SPRINT_MULTIPLIER- See Also:
-
WALK_OFF_BLOCK_COST
public static final double WALK_OFF_BLOCK_COSTTo walk off an edge you need to walk 0.5 to the edge then 0.3 to start falling off- See Also:
-
CENTER_AFTER_FALL_COST
public static final double CENTER_AFTER_FALL_COSTTo walk the rest of the way to be centered on the new block- See Also:
-
COST_INF
public static final double COST_INFdon't make this Double.MAX_VALUE because it's added to other things, maybe other COST_INFs, and that would make it overflow to negative- See Also:
-
FALL_N_BLOCKS_COST
public static final double[] FALL_N_BLOCKS_COST -
FALL_1_25_BLOCKS_COST
public static final double FALL_1_25_BLOCKS_COST -
FALL_0_25_BLOCKS_COST
public static final double FALL_0_25_BLOCKS_COST -
JUMP_ONE_BLOCK_COST
public static final double JUMP_ONE_BLOCK_COSTWhen you hit space, you get enough upward velocity to go 1.25 blocks Then, you fall the remaining 0.25 to get on the surface, on block higher. Since parabolas are symmetric, the amount of time it takes to ascend up from 1 to 1.25 will be the same amount of time that it takes to fall back down from 1.25 to 1. And the same applies to the overall shape, if it takes X ticks to fall back down 1.25 blocks, it will take X ticks to reach the peak of your 1.25 block leap. Therefore, the part of your jump from y=0 to y=1.25 takes distanceToTicks(1.25) ticks, and the sub-part from y=1 to y=1.25 takes distanceToTicks(0.25) ticks. Therefore, the other sub-part, from y=0 to y-1, takes distanceToTicks(1.25)-distanceToTicks(0.25) ticks. That's why JUMP_ONE_BLOCK_COST = FALL_1_25_BLOCKS_COST - FALL_0_25_BLOCKS_COST
-