Fix #379 handle unknown block colors in noise settings preview

This commit is contained in:
Misode
2023-05-29 22:42:23 +02:00
parent 97e9961919
commit a78bb6c2a4

View File

@@ -60,7 +60,7 @@ export const NoiseSettingsPreview = ({ data, shown, version }: PreviewProps) =>
iterateWorld2D(imageData.current, transform, (x, y) => {
return DEEPSLATE.getBlockState(x, y)?.getName().toString()
}, (block) => {
return BlockColors[block ?? 'minecraft:air']
return BlockColors[block ?? 'minecraft:air'] ?? [0, 0, 0]
})
} else if (layer === 'final_density') {
const colormapFn = getColormap(colormap)