mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 13:08:19 +01:00
Fix Palette#resize not actually resizing the palette (#503)
This commit is contained in:
parent
c5f4ce8515
commit
afdc67fc26
@ -145,9 +145,6 @@ public final class Palette implements PublicCloneable<Palette> {
|
|||||||
newBitsPerEntry = fixBitsPerEntry(newBitsPerEntry);
|
newBitsPerEntry = fixBitsPerEntry(newBitsPerEntry);
|
||||||
|
|
||||||
Palette palette = new Palette(newBitsPerEntry, bitsIncrement);
|
Palette palette = new Palette(newBitsPerEntry, bitsIncrement);
|
||||||
palette.paletteBlockArray = paletteBlockArray;
|
|
||||||
palette.blockPaletteMap = blockPaletteMap;
|
|
||||||
palette.lastPaletteIndex = lastPaletteIndex;
|
|
||||||
|
|
||||||
for (int y = 0; y < Chunk.CHUNK_SECTION_SIZE; y++) {
|
for (int y = 0; y < Chunk.CHUNK_SECTION_SIZE; y++) {
|
||||||
for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
|
for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
|
||||||
@ -251,6 +248,7 @@ public final class Palette implements PublicCloneable<Palette> {
|
|||||||
if (lastPaletteIndex >= paletteBlockArray.length) {
|
if (lastPaletteIndex >= paletteBlockArray.length) {
|
||||||
// Palette is full, must resize
|
// Palette is full, must resize
|
||||||
resize(bitsPerEntry + bitsIncrement);
|
resize(bitsPerEntry + bitsIncrement);
|
||||||
|
if (!hasPalette) return blockId;
|
||||||
}
|
}
|
||||||
final short paletteIndex = (short) lastPaletteIndex++;
|
final short paletteIndex = (short) lastPaletteIndex++;
|
||||||
this.paletteBlockArray[paletteIndex] = blockId;
|
this.paletteBlockArray[paletteIndex] = blockId;
|
||||||
|
Loading…
Reference in New Issue
Block a user