Fix some more edge cases
This commit is contained in:
@@ -127,7 +127,8 @@ public class MovementDiagonal extends Movement {
|
|||||||
destWalkOn = destInto;
|
destWalkOn = destInto;
|
||||||
} else {
|
} else {
|
||||||
destWalkOn = context.get(destX, y - 1, destZ);
|
destWalkOn = context.get(destX, y - 1, destZ);
|
||||||
frostWalker = MovementHelper.canUseFrostWalker(context, destWalkOn) && !(context.assumeWalkOnWater && context.getBlock(x, y - 1, z) instanceof BlockLiquid);
|
boolean standingOnABlock = !(context.getBlock(x, y - 1, z) instanceof BlockLiquid) || (!context.assumeWalkOnWater && !(context.getBlock(x, y, z) instanceof BlockLiquid));
|
||||||
|
frostWalker = standingOnABlock && MovementHelper.canUseFrostWalker(context, destWalkOn);
|
||||||
if (!MovementHelper.canWalkOn(context.bsi, destX, y - 1, destZ, destWalkOn) && !frostWalker) {
|
if (!MovementHelper.canWalkOn(context.bsi, destX, y - 1, destZ, destWalkOn) && !frostWalker) {
|
||||||
descend = true;
|
descend = true;
|
||||||
if (!context.allowDiagonalDescend || !MovementHelper.canWalkOn(context.bsi, destX, y - 2, destZ) || !MovementHelper.canWalkThrough(context.bsi, destX, y - 1, destZ, destWalkOn)) {
|
if (!context.allowDiagonalDescend || !MovementHelper.canWalkOn(context.bsi, destX, y - 2, destZ) || !MovementHelper.canWalkThrough(context.bsi, destX, y - 1, destZ, destWalkOn)) {
|
||||||
|
@@ -73,7 +73,10 @@ public class MovementTraverse extends Movement {
|
|||||||
IBlockState pb1 = context.get(destX, y, destZ);
|
IBlockState pb1 = context.get(destX, y, destZ);
|
||||||
IBlockState destOn = context.get(destX, y - 1, destZ);
|
IBlockState destOn = context.get(destX, y - 1, destZ);
|
||||||
Block srcDown = context.getBlock(x, y - 1, z);
|
Block srcDown = context.getBlock(x, y - 1, z);
|
||||||
if (MovementHelper.canWalkOn(context.bsi, destX, y - 1, destZ, destOn) || MovementHelper.canUseFrostWalker(context, destOn)) { //this is a walk, not a bridge
|
// if we are on water but are neither in water nor can stand on water we must have placed a block to get here
|
||||||
|
boolean standingOnABlock = !(srcDown instanceof BlockLiquid) || (!context.assumeWalkOnWater && !(context.getBlock(x, y, z) instanceof BlockLiquid));
|
||||||
|
boolean frostWalker = standingOnABlock && MovementHelper.canUseFrostWalker(context, destOn);
|
||||||
|
if (MovementHelper.canWalkOn(context.bsi, destX, y - 1, destZ, destOn) || frostWalker) { //this is a walk, not a bridge
|
||||||
double WC = WALK_ONE_BLOCK_COST;
|
double WC = WALK_ONE_BLOCK_COST;
|
||||||
boolean water = false;
|
boolean water = false;
|
||||||
if (MovementHelper.isWater(pb0.getBlock()) || MovementHelper.isWater(pb1.getBlock())) {
|
if (MovementHelper.isWater(pb0.getBlock()) || MovementHelper.isWater(pb1.getBlock())) {
|
||||||
@@ -82,7 +85,7 @@ public class MovementTraverse extends Movement {
|
|||||||
} else {
|
} else {
|
||||||
if (destOn.getBlock() == Blocks.SOUL_SAND) {
|
if (destOn.getBlock() == Blocks.SOUL_SAND) {
|
||||||
WC += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2;
|
WC += (WALK_ONE_OVER_SOUL_SAND_COST - WALK_ONE_BLOCK_COST) / 2;
|
||||||
} else if (MovementHelper.canUseFrostWalker(context, destOn) && !context.assumeWalkOnWater) {
|
} else if (frostWalker) {
|
||||||
// with frostwalker we can walk on water without the penalty, if we are sure we won't be using jesus
|
// with frostwalker we can walk on water without the penalty, if we are sure we won't be using jesus
|
||||||
} else if (destOn.getBlock() == Blocks.WATER) {
|
} else if (destOn.getBlock() == Blocks.WATER) {
|
||||||
WC += context.walkOnWaterOnePenalty;
|
WC += context.walkOnWaterOnePenalty;
|
||||||
|
Reference in New Issue
Block a user