3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 13:52:50 +02:00

Biome palettes entries can have 1 bit

Dieser Commit ist enthalten in:
Nassim Jahnke 2021-09-16 15:47:28 +02:00
Ursprung 5a90c8374c
Commit 111cd2fd46
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -89,7 +89,8 @@ public final class PaletteType1_18 extends PartialType<DataPalette, PaletteType>
public void write(final ByteBuf buffer, final PaletteType type, final DataPalette palette) throws Exception {
int bitsPerValue;
if (palette.size() > 1) {
bitsPerValue = type == PaletteType.BLOCKS ? 4 : 2; //TODO implement linear palette
// 1, 2, and 3 bit linear palettes can't be read by the client
bitsPerValue = type == PaletteType.BLOCKS ? 4 : 1;
while (palette.size() > 1 << bitsPerValue) {
bitsPerValue += 1;
}