Fix palette resize issue

This commit is contained in:
StackDoubleFlow 2021-03-15 22:19:13 -05:00
parent 8b0ab3d8c3
commit b648d7561c

View File

@ -275,7 +275,7 @@ public class PaletteStorage implements PublicCloneable<PaletteStorage> {
final int section = ChunkUtils.getSectionAt(y);
final int valuesPerLong = paletteStorage.valuesPerLong;
int valuesPerLong = paletteStorage.valuesPerLong;
if (paletteStorage.sectionBlocks[section].length == 0) {
if (blockId == 0) {
@ -294,6 +294,9 @@ public class PaletteStorage implements PublicCloneable<PaletteStorage> {
// Change to palette value
blockId = paletteStorage.getPaletteIndex(section, blockId);
// The storage could have been resized
valuesPerLong = paletteStorage.valuesPerLong;
final int sectionIndex = getSectionIndex(x, y, z);
final int index = sectionIndex / valuesPerLong;