Mostly working usage of frostwalker

* Sometimes overshoots Descend-Traverse chains onto water
* Unwanted interactions with assumeWalkOnWater
This commit is contained in:
ZacSharp
2022-08-29 12:53:02 +02:00
parent 17a2aa42e9
commit e75a4b95cc
6 changed files with 30 additions and 6 deletions

View File

@@ -360,6 +360,12 @@ public interface MovementHelper extends ActionCosts, Helper {
return canWalkOn(bsi, x, y, z, bsi.get0(x, y, z));
}
static boolean canUseFrostWalker(CalculationContext context, IBlockState state) {
return context.frostWalker != 0
&& (state.getBlock() == Blocks.WATER || state.getBlock() == Blocks.FLOWING_WATER)
&& ((Integer) state.getValue(BlockLiquid.LEVEL)) == 0;
}
static boolean canPlaceAgainst(BlockStateInterface bsi, int x, int y, int z) {
return canPlaceAgainst(bsi, x, y, z, bsi.get0(x, y, z));
}