fix snow and tweak others
This commit is contained in:
parent
0587223da8
commit
658048ff2d
@ -137,10 +137,8 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (block instanceof BlockSnow) {
|
if (block instanceof BlockSnow) {
|
||||||
if (state.getValue(BlockSnow.LAYERS) >= 3) {
|
// snow layers cached as the top layer of a packed chunk have no metadata, we can't make a decision based on their depth here
|
||||||
return NO;
|
// it would otherwise make long distance pathing through snowy biomes impossible
|
||||||
}
|
|
||||||
|
|
||||||
return MAYBE;
|
return MAYBE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +173,18 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
return canWalkOn(bsi, x, y - 1, z);
|
return canWalkOn(bsi, x, y - 1, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block instanceof BlockSnow) { // TODO see if this case is necessary, shouldn't it also check this somewhere else?
|
if (block instanceof BlockSnow) {
|
||||||
|
// if they're cached as a top block, we don't know their metadata
|
||||||
|
// default to true (mostly because it would otherwise make long distance pathing through snowy biomes impossible)
|
||||||
|
if (!bsi.worldContainsLoadedChunk(x, z)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// the check in BlockSnow.isPassable is layers < 5
|
||||||
|
// while actually, we want < 3 because 3 or greater makes it impassable in a 2 high ceiling
|
||||||
|
if (state.getValue(BlockSnow.LAYERS) >= 3) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// ok, it's low enough we could walk through it, but is it supported?
|
||||||
return canWalkOn(bsi, x, y - 1, z);
|
return canWalkOn(bsi, x, y - 1, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,10 +372,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
|
|
||||||
static Ternary canWalkOnBlockState(IBlockState state) {
|
static Ternary canWalkOnBlockState(IBlockState state) {
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
if (block == Blocks.AIR || block == Blocks.MAGMA) {
|
if (state.isBlockNormalCube() && block != Blocks.MAGMA) {
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
if (state.isBlockNormalCube()) {
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
if (block == Blocks.LADDER || (block == Blocks.VINE && Baritone.settings().allowVines.value)) { // TODO reconsider this
|
if (block == Blocks.LADDER || (block == Blocks.VINE && Baritone.settings().allowVines.value)) { // TODO reconsider this
|
||||||
@ -378,17 +384,18 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
if (block == Blocks.ENDER_CHEST || block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST) {
|
if (block == Blocks.ENDER_CHEST || block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST) {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
if (isWater(block)) {
|
|
||||||
return MAYBE;
|
|
||||||
}
|
|
||||||
if (Baritone.settings().assumeWalkOnLava.value && MovementHelper.isLava(block)) {
|
|
||||||
return MAYBE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (block == Blocks.GLASS || block == Blocks.STAINED_GLASS) {
|
if (block == Blocks.GLASS || block == Blocks.STAINED_GLASS) {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
if (block instanceof BlockStairs) {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
if (isWater(block)) {
|
||||||
|
return MAYBE;
|
||||||
|
}
|
||||||
|
if (MovementHelper.isLava(block) && Baritone.settings().assumeWalkOnLava.value) {
|
||||||
|
return MAYBE;
|
||||||
|
}
|
||||||
if (block instanceof BlockSlab) {
|
if (block instanceof BlockSlab) {
|
||||||
if (!Baritone.settings().allowWalkOnBottomSlab.value) {
|
if (!Baritone.settings().allowWalkOnBottomSlab.value) {
|
||||||
if (((BlockSlab) block).isDouble()) {
|
if (((BlockSlab) block).isDouble()) {
|
||||||
@ -401,11 +408,6 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block instanceof BlockStairs) {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +429,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
return isWater(up) ^ Baritone.settings().assumeWalkOnWater.value;
|
return isWater(up) ^ Baritone.settings().assumeWalkOnWater.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Baritone.settings().assumeWalkOnLava.value && MovementHelper.isLava(block) && !MovementHelper.isFlowing(x, y, z, state, bsi)) {
|
if (MovementHelper.isLava(block) && !MovementHelper.isFlowing(x, y, z, state, bsi) && Baritone.settings().assumeWalkOnLava.value) { // if we get here it means that assumeWalkOnLava must be true, so put it last
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user