Skip to content

Commit 06f986d

Browse files
committed
🛠️ Fix #304
1 parent 58e208f commit 06f986d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/systems/minecraft/itemModelManager.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,13 @@ async function generateItemMesh(location: string, model: IItemModel): Promise<It
231231
}
232232
const matrix2 = matrix1.slice()
233233

234+
let pixel = 0
234235
for (let y = 0; y < canvas.height; y++) {
235-
let lengthX = 0
236236
for (let x = 0; x < canvas.width; x++) {
237-
const pixel = x == 0 ? 0 : matrix1[y * canvas.width + x]
237+
pixel = matrix1[y * canvas.width + x]
238238
if (pixel) {
239-
lengthX++
240-
} else if (lengthX) {
241-
addFace(x - lengthX, y, lengthX, 1, 1)
242-
addFace(x - lengthX, y, lengthX, 1, -1)
243-
lengthX = 0
239+
addFace(x, y, 1, 1, 1)
240+
addFace(x, y, 1, 1, -1)
244241
}
245242
}
246243
}

0 commit comments

Comments
 (0)