Skip to content

Commit

Permalink
Edit comments and add TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Apr 23, 2024
1 parent f9af960 commit f1c0680
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static PathNodeType getNodeTypeFromNeighbors(PathContext context, int x,
// section is empty or contains any dangerous blocks within the palette. If not, we can assume any checks
// against this chunk section will always fail, allowing us to fast-exit.
if (section == null || PathNodeCache.isSectionSafeAsNeighbor(section)) {
return fallback;
return fallback; //TODO side effects of vanilla's path node caching
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ private boolean nextSection() {
return false; //no more sections to iterate
}
}
//Casting to Chunk is not checked, together with other mods this could cause a ClassCastException
this.cachedChunk = this.world.getChunk(this.chunkX, this.chunkZ, ChunkStatus.FULL, false);
if (this.cachedChunk != null) {
this.cachedChunkSection = this.cachedChunk.getSectionArray()[this.chunkYIndex];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class VoxelShapeAlignedCuboid extends VoxelShapeSimpleCube {
//EPSILON for use in cases where it must be a lot smaller than 1/256 and larger than EPSILON
static final double LARGE_EPSILON = 10 * EPSILON;

//In bit aligned shapes the bitset adds segments are between minX/Y/Z and maxX/Y/Z.
//In bit-aligned shapes the bitset adds segments are between minX/Y/Z and maxX/Y/Z.
//Segments all have the same size. There is an additional collision box between two adjacent segments (if both are inside the shape)
protected final byte xyzResolution;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public VoxelShapeAlignedCuboidOffset(VoxelShapeAlignedCuboid originalShape, Voxe
originalShape.maxX + xOffset, originalShape.maxY + yOffset, originalShape.maxZ + zOffset, originalShape.xyzResolution);

if (originalShape instanceof VoxelShapeAlignedCuboidOffset) {
this.xOffset = ((VoxelShapeAlignedCuboidOffset) originalShape).xOffset + xOffset;
this.yOffset = ((VoxelShapeAlignedCuboidOffset) originalShape).yOffset + yOffset;
this.zOffset = ((VoxelShapeAlignedCuboidOffset) originalShape).zOffset + zOffset;
this.xOffset = ((VoxelShapeAlignedCuboidOffset) originalShape).xOffset + xOffset; //TODO the float addition here might cause non-vanilla floating point errors
this.yOffset = ((VoxelShapeAlignedCuboidOffset) originalShape).yOffset + yOffset; // Float non-associativity technically causes an issue here
this.zOffset = ((VoxelShapeAlignedCuboidOffset) originalShape).zOffset + zOffset; // In practice, this is likely not a problem
} else {
this.xOffset = xOffset;
this.yOffset = yOffset;
Expand Down

0 comments on commit f1c0680

Please sign in to comment.