From 9fe7b455582098bf24f8f74839559a0340146ef9 Mon Sep 17 00:00:00 2001 From: Roujel Williams Date: Wed, 18 Dec 2024 09:12:57 -0500 Subject: [PATCH] Fixed advanced rotations of large structures --- src/server/modules/region_buffer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/modules/region_buffer.ts b/src/server/modules/region_buffer.ts index 312937ac8..1d788720b 100644 --- a/src/server/modules/region_buffer.ts +++ b/src/server/modules/region_buffer.ts @@ -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))); }