epicer cached bedrock level pathing

This commit is contained in:
Leijurv
2019-08-08 18:09:25 -10:00
parent 3d221dcda4
commit 4c935fc447
+14 -2
View File
@@ -26,7 +26,10 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import java.util.*; import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
import java.util.Map;
/** /**
* @author Brady * @author Brady
@@ -179,9 +182,18 @@ public final class CachedChunk {
} }
} }
if (type == PathingBlockType.SOLID && y == 127 && dimension == -1) { if (type == PathingBlockType.SOLID) {
if (y == 127 && dimension == -1) {
// nether roof is always unbreakable
return Blocks.BEDROCK.getDefaultState(); return Blocks.BEDROCK.getDefaultState();
} }
if (y < 5 && dimension == 0) {
// solid blocks below 5 are commonly bedrock
// however, returning bedrock always would be a little yikes
// discourage paths that include breaking blocks below 5 a little more heavily just so that it takes paths breaking what's known to be stone (at 5 or above) instead of what could maybe be bedrock (below 5)
return Blocks.OBSIDIAN.getDefaultState();
}
}
return ChunkPacker.pathingTypeToBlock(type, dimension); return ChunkPacker.pathingTypeToBlock(type, dimension);
} }