From 46648d92da7f5f8acc23546b3bc700ec2f8c1580 Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Tue, 7 Jan 2025 20:08:39 +0000 Subject: [PATCH] refactor: fix spelling mistakes --- src/components/dialogs/SaveLitematic.tsx | 10 +++++----- src/components/dialogs/SaveSchem.tsx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/dialogs/SaveLitematic.tsx b/src/components/dialogs/SaveLitematic.tsx index cdbfb9f..640d8e2 100644 --- a/src/components/dialogs/SaveLitematic.tsx +++ b/src/components/dialogs/SaveLitematic.tsx @@ -40,8 +40,8 @@ function SaveLitematic({ close }: DialogProps) { } } - // Generate the block pallete - const blockStatePallete = [ + // Generate the block palette + const blockStatePalette = [ { Name: "minecraft:air" }, ...Array.from( new Set( @@ -61,14 +61,14 @@ function SaveLitematic({ close }: DialogProps) { ]; // Get the block states - const requiredBits = Math.max(Math.ceil(Math.log2(blockStatePallete.length)), 2); + const requiredBits = Math.max(Math.ceil(Math.log2(blockStatePalette.length)), 2); const blockStates = new BigInt64Array(Math.ceil((filledBlocks.length * requiredBits) / 64)); filledBlocks.forEach((block) => { const blockInfo = blockData[block.name.replace("minecraft:", "")]; const blockName = blockInfo ? blockInfo.id[0].toString() : block.name; - const blockId = blockStatePallete.findIndex((entry) => entry.Name === `minecraft:${blockName}`); + const blockId = blockStatePalette.findIndex((entry) => entry.Name === `minecraft:${blockName}`); const reversedY = height - 1 - block.y; const index = reversedY * width + block.x; @@ -122,7 +122,7 @@ function SaveLitematic({ close }: DialogProps) { z: new nbt.Int32(1), }, BlockStates: blockStates, - BlockStatePalette: blockStatePallete, + BlockStatePalette: blockStatePalette, TileEntities: [], Entities: [], PendingBlockTicks: [], diff --git a/src/components/dialogs/SaveSchem.tsx b/src/components/dialogs/SaveSchem.tsx index 4125a02..95a2954 100644 --- a/src/components/dialogs/SaveSchem.tsx +++ b/src/components/dialogs/SaveSchem.tsx @@ -48,8 +48,8 @@ function SaveLitematic({ close }: DialogProps) { return a.x - b.x; }); - // Generate the block pallete - const blockPallete = Array.from( + // Generate the block palette + const blockPalette = Array.from( new Set( filledBlocks.map((block) => { const blockInfo = blockData[block.name.replace("minecraft:", "")]; @@ -78,7 +78,7 @@ function SaveLitematic({ close }: DialogProps) { .map(([key, value]) => `${key}=${value}`) .join(",")}]` : ""; - const blockId = blockPallete[`minecraft:${blockName}${properties}`]; + const blockId = blockPalette[`minecraft:${blockName}${properties}`]; blockPlaceData[index] = parseInt(blockId.toString()); }); @@ -96,7 +96,7 @@ function SaveLitematic({ close }: DialogProps) { }, Blocks: { Data: blockPlaceData, - Palette: blockPallete, + Palette: blockPalette, }, }, };