mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-14 04:02:00 +01:00
Fix palette size when filling to 0
This commit is contained in:
parent
d4eaeffb30
commit
4c31d73bbf
@ -147,7 +147,7 @@ final class PaletteImpl implements Palette, Cloneable {
|
|||||||
block |= (long) value << i * bitsPerEntry;
|
block |= (long) value << i * bitsPerEntry;
|
||||||
}
|
}
|
||||||
Arrays.fill(values, block);
|
Arrays.fill(values, block);
|
||||||
this.count = maxSize();
|
this.count = placedAir ? 0 : maxSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,6 +96,16 @@ public class PaletteTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
palette.fill(0);
|
||||||
|
assertEquals(0, palette.size());
|
||||||
|
for (int y = 0; y < palette.dimension(); y++) {
|
||||||
|
for (int x = 0; x < palette.dimension(); x++) {
|
||||||
|
for (int z = 0; z < palette.dimension(); z++) {
|
||||||
|
assertEquals(0, palette.get(x, y, z));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user