From 68d753f741c1d459f3e0e937b5fcbe36a05e008d Mon Sep 17 00:00:00 2001 From: granny Date: Fri, 20 Oct 2023 03:45:53 -0700 Subject: [PATCH] use bit masking instead of bit shifting --- webmap/src/palette/Block.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webmap/src/palette/Block.ts b/webmap/src/palette/Block.ts index 32cc5e632..2a8c15893 100644 --- a/webmap/src/palette/Block.ts +++ b/webmap/src/palette/Block.ts @@ -6,8 +6,8 @@ export class Block { constructor(packed: number, minY: number) { this._block = packed >>> 22; - this._biome = (packed << 10) >> 22; - this._yPos = ((packed << 20) >> 20); + this._biome = (packed & 0b0000000000_1111111111_000000000000) >>> 12; + this._yPos = packed & 0b0000000000_0000000000_111111111111; this._minY = minY; }