fix palettes below y=0

This commit is contained in:
dfsek 2021-03-17 21:22:04 -07:00
parent d065f78c0a
commit c9f49fb06f

View File

@ -21,7 +21,7 @@ public class PaletteHolderBuilder {
int min = FastMath.min(paletteMap.keySet().stream().min(Integer::compareTo).orElse(0), 0); int min = FastMath.min(paletteMap.keySet().stream().min(Integer::compareTo).orElse(0), 0);
Palette<BlockData>[] palettes = new Palette[paletteMap.lastKey() + 1 - min]; Palette<BlockData>[] palettes = new Palette[paletteMap.lastKey() + 1 - min];
for(int y = 0; y <= FastMath.max(paletteMap.lastKey(), 255); y++) { for(int y = min; y <= FastMath.max(paletteMap.lastKey(), 255); y++) {
Palette<BlockData> d = null; Palette<BlockData> d = null;
for(Map.Entry<Integer, Palette<BlockData>> e : paletteMap.entrySet()) { for(Map.Entry<Integer, Palette<BlockData>> e : paletteMap.entrySet()) {
if(e.getKey() >= y) { if(e.getKey() >= y) {