block pathing work
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
c0627bf3fb
commit
eb7df4093a
@ -1676,6 +1676,7 @@ Digging produces terrain item form
|
|||||||
Terrain items can be placed to place terrain
|
Terrain items can be placed to place terrain
|
||||||
Recipe adjustment + voxel work
|
Recipe adjustment + voxel work
|
||||||
Recursive recipe item sourcing solver that keeps searching if a recipe fails to source
|
Recursive recipe item sourcing solver that keeps searching if a recipe fails to source
|
||||||
|
Block pathing work
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,6 +32,11 @@ public class VoxelPathfinder {
|
|||||||
*/
|
*/
|
||||||
public static final int DEFAULT_MAX_COST = 12000;
|
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
|
* Maximum distance to scan for a walkable position
|
||||||
*/
|
*/
|
||||||
@ -905,9 +910,9 @@ public class VoxelPathfinder {
|
|||||||
Vector3i currChunk = new Vector3i(chunkPos);
|
Vector3i currChunk = new Vector3i(chunkPos);
|
||||||
Vector3i offsets = new Vector3i();
|
Vector3i offsets = new Vector3i();
|
||||||
int numBlocks = 0;
|
int numBlocks = 0;
|
||||||
for(int x = 0; x < 4; x++){
|
for(int x = -1; x < 4; x++){
|
||||||
for(int y = 0; y < 4; y++){
|
for(int y = -2; y < 4; y++){
|
||||||
for(int z = 0; z < 4; z++){
|
for(int z = -1; z < 3; z++){
|
||||||
blockPos.set(voxelPos).mul(BlockChunkData.BLOCKS_PER_UNIT_DISTANCE);
|
blockPos.set(voxelPos).mul(BlockChunkData.BLOCKS_PER_UNIT_DISTANCE);
|
||||||
currChunk.set(chunkPos);
|
currChunk.set(chunkPos);
|
||||||
offsets.set(
|
offsets.set(
|
||||||
@ -927,7 +932,7 @@ public class VoxelPathfinder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean blocksChestHeight = numBlocks > 10;
|
boolean blocksChestHeight = numBlocks > MAX_BLOCKS_FOR_WALKABLE;
|
||||||
|
|
||||||
return standingOnGround && aboveIsAir && !blocksChestHeight;
|
return standingOnGround && aboveIsAir && !blocksChestHeight;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user