mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-24 00:51:34 +01:00
Merge pull request #172 from StackDoubleFlow/master
Fix palette resize issue
This commit is contained in:
commit
bda4658cba
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user