Skip to content

Commit

Permalink
Fixed advanced rotations of large structures
Browse files Browse the repository at this point in the history
  • Loading branch information
SIsilicon committed Dec 18, 2024
1 parent c3de527 commit 9fe7b45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/modules/region_buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ export class RegionBuffer {

private getBlockMulti(loc: Vector3) {
if (loc.x < 0 || loc.x >= this.size.x || loc.y < 0 || loc.y >= this.size.y || loc.z < 0 || loc.z >= this.size.z) return undefined;
const offset = { x: loc.x / RegionBuffer.MAX_SIZE.x, y: loc.y / RegionBuffer.MAX_SIZE.y, z: loc.z / RegionBuffer.MAX_SIZE.z };
const offset = { x: Math.floor(loc.x / RegionBuffer.MAX_SIZE.x), y: Math.floor(loc.y / RegionBuffer.MAX_SIZE.y), z: Math.floor(loc.z / RegionBuffer.MAX_SIZE.z) };
const structure = this.structures[locToString(offset)];
return new RegionBlockImpl(this, this.extraBlockData, loc, structure, Vector.sub(loc, Vector.mul(offset, RegionBuffer.MAX_SIZE)));
}
Expand Down

0 comments on commit 9fe7b45

Please sign in to comment.