Retain old method signature
This commit is contained in:
parent
43ab4f7d3b
commit
5201d39adf
@ -141,14 +141,18 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
* canWalkThrough but also won't impede movement at all. so not including doors or fence gates (we'd have to right click),
|
* 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)
|
* not including water, and not including ladders or vines or cobwebs (they slow us down)
|
||||||
*
|
*
|
||||||
* @param bsi Block State Interface to provide block state lookup
|
* @param context Calculation context to provide block state lookup
|
||||||
* @param x The block's x position
|
* @param x The block's x position
|
||||||
* @param y The block's y position
|
* @param y The block's y position
|
||||||
* @param z The block's z position
|
* @param z The block's z position
|
||||||
* @return Whether or not the block at the specified position
|
* @return Whether or not the block at the specified position
|
||||||
*/
|
*/
|
||||||
static boolean fullyPassable(BlockStateInterface bsi, int x, int y, int z) {
|
static boolean fullyPassable(CalculationContext context, int x, int y, int z) {
|
||||||
return fullyPassable(bsi.world, bsi.isPassableBlockPos.setPos(x, y, z), bsi.get0(x, y, z));
|
return fullyPassable(
|
||||||
|
context.bsi.world,
|
||||||
|
context.bsi.isPassableBlockPos.setPos(x, y, z),
|
||||||
|
context.bsi.get0(x, y, z)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean fullyPassable(IPlayerContext ctx, BlockPos pos) {
|
static boolean fullyPassable(IPlayerContext ctx, BlockPos pos) {
|
||||||
|
@ -69,7 +69,7 @@ public class MovementParkour extends Movement {
|
|||||||
|
|
||||||
int xDiff = dir.getXOffset();
|
int xDiff = dir.getXOffset();
|
||||||
int zDiff = dir.getZOffset();
|
int zDiff = dir.getZOffset();
|
||||||
if (!MovementHelper.fullyPassable(context.bsi, x + xDiff, y, z + zDiff)) {
|
if (!MovementHelper.fullyPassable(context, x + xDiff, y, z + zDiff)) {
|
||||||
// most common case at the top -- the adjacent block isn't air
|
// most common case at the top -- the adjacent block isn't air
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -81,13 +81,13 @@ public class MovementParkour extends Movement {
|
|||||||
if (MovementHelper.avoidWalkingInto(adj.getBlock()) && adj.getBlock() != Blocks.WATER && adj.getBlock() != Blocks.FLOWING_WATER) { // magma sucks
|
if (MovementHelper.avoidWalkingInto(adj.getBlock()) && adj.getBlock() != Blocks.WATER && adj.getBlock() != Blocks.FLOWING_WATER) { // magma sucks
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!MovementHelper.fullyPassable(context.bsi, x + xDiff, y + 1, z + zDiff)) {
|
if (!MovementHelper.fullyPassable(context, x + xDiff, y + 1, z + zDiff)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!MovementHelper.fullyPassable(context.bsi, x + xDiff, y + 2, z + zDiff)) {
|
if (!MovementHelper.fullyPassable(context, x + xDiff, y + 2, z + zDiff)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!MovementHelper.fullyPassable(context.bsi, x, y + 2, z)) {
|
if (!MovementHelper.fullyPassable(context, x, y + 2, z)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IBlockState standingOn = context.get(x, y - 1, z);
|
IBlockState standingOn = context.get(x, y - 1, z);
|
||||||
@ -107,10 +107,10 @@ public class MovementParkour extends Movement {
|
|||||||
for (int i = 2; i <= maxJump; i++) {
|
for (int i = 2; i <= maxJump; i++) {
|
||||||
int destX = x + xDiff * i;
|
int destX = x + xDiff * i;
|
||||||
int destZ = z + zDiff * i;
|
int destZ = z + zDiff * i;
|
||||||
if (!MovementHelper.fullyPassable(context.bsi, destX, y + 1, destZ)) {
|
if (!MovementHelper.fullyPassable(context, destX, y + 1, destZ)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!MovementHelper.fullyPassable(context.bsi, destX, y + 2, destZ)) {
|
if (!MovementHelper.fullyPassable(context, destX, y + 2, destZ)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IBlockState destInto = context.bsi.get0(destX, y, destZ);
|
IBlockState destInto = context.bsi.get0(destX, y, destZ);
|
||||||
@ -134,7 +134,7 @@ public class MovementParkour extends Movement {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!MovementHelper.fullyPassable(context.bsi, destX, y + 3, destZ)) {
|
if (!MovementHelper.fullyPassable(context, destX, y + 3, destZ)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user