only fail on movement cost increase if calced through cached, fixes #165

This commit is contained in:
Leijurv
2018-09-13 16:18:26 -07:00
parent 924cea342b
commit e3830643f6
5 changed files with 35 additions and 2 deletions
@@ -26,6 +26,7 @@ import baritone.utils.pathing.BetterBlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.chunk.EmptyChunk;
import java.util.ArrayList;
import java.util.Arrays;
@@ -290,6 +291,16 @@ public abstract class Movement implements Helper, MovementHelper {
return getDest().subtract(getSrc());
}
private Boolean calculatedWhileLoaded;
public void checkLoadedChunk() {
calculatedWhileLoaded = !(world().getChunk(getDest()) instanceof EmptyChunk);
}
public boolean calculatedWhileLoaded() {
return calculatedWhileLoaded;
}
public List<BlockPos> toBreakCached = null;
public List<BlockPos> toPlaceCached = null;
public List<BlockPos> toWalkIntoCached = null;