refactor: fix spelling mistakes

This commit is contained in:
trafficlunar 2025-01-07 20:08:39 +00:00
parent 26fb017d2d
commit 46648d92da
2 changed files with 9 additions and 9 deletions

View file

@ -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: [],

View file

@ -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,
},
},
};