block pathing work
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-04 19:35:30 -04:00
parent c0627bf3fb
commit eb7df4093a
2 changed files with 10 additions and 4 deletions

View File

@ -1676,6 +1676,7 @@ Digging produces terrain item form
Terrain items can be placed to place terrain
Recipe adjustment + voxel work
Recursive recipe item sourcing solver that keeps searching if a recipe fails to source
Block pathing work

View File

@ -32,6 +32,11 @@ public class VoxelPathfinder {
*/
public static final int DEFAULT_MAX_COST = 12000;
/**
* Maximum number of blocks for a walkable position
*/
static final int MAX_BLOCKS_FOR_WALKABLE = 0;
/**
* Maximum distance to scan for a walkable position
*/
@ -905,9 +910,9 @@ public class VoxelPathfinder {
Vector3i currChunk = new Vector3i(chunkPos);
Vector3i offsets = new Vector3i();
int numBlocks = 0;
for(int x = 0; x < 4; x++){
for(int y = 0; y < 4; y++){
for(int z = 0; z < 4; z++){
for(int x = -1; x < 4; x++){
for(int y = -2; y < 4; y++){
for(int z = -1; z < 3; z++){
blockPos.set(voxelPos).mul(BlockChunkData.BLOCKS_PER_UNIT_DISTANCE);
currChunk.set(chunkPos);
offsets.set(
@ -927,7 +932,7 @@ public class VoxelPathfinder {
}
}
}
boolean blocksChestHeight = numBlocks > 10;
boolean blocksChestHeight = numBlocks > MAX_BLOCKS_FOR_WALKABLE;
return standingOnGround && aboveIsAir && !blocksChestHeight;
}