3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Fix instances of resizing global biome palettes

Fixes #2744
Dieser Commit ist enthalten in:
Camotoy 2022-04-24 13:58:34 -04:00
Ursprung 9bf3334cb0
Commit 0d1fedbdbf
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -126,11 +126,10 @@ public class BiomeTranslator {
storage = new BlockStorage(bitArray, bedrockPalette); storage = new BlockStorage(bitArray, bedrockPalette);
} else { } else {
storage = new BlockStorage(0); storage = new BlockStorage(0);
BitArray bitArray = storage.getBitArray();
// Each section of biome corresponding to a chunk section contains 4 * 4 * 4 entries // Each section of biome corresponding to a chunk section contains 4 * 4 * 4 entries
for (int i = 0; i < 64; i++) { for (int i = 0; i < 64; i++) {
int javaId = biomeData.getPalette().idToState(biomeData.getStorage().get(i)); int javaId = palette.idToState(biomeData.getStorage().get(i));
int x = i & 3; int x = i & 3;
int y = (i >> 4) & 3; int y = (i >> 4) & 3;
int z = (i >> 2) & 3; int z = (i >> 2) & 3;
@ -139,7 +138,9 @@ public class BiomeTranslator {
int idx = storage.idFor(biomeId); int idx = storage.idFor(biomeId);
// Convert biome coordinates into block coordinates // Convert biome coordinates into block coordinates
// Bedrock expects a full 4096 blocks // Bedrock expects a full 4096 blocks
multiplyIdToStorage(bitArray, idx, x, y, z); // Implementation note: storage.getBitArray() must be called and not stored - if the palette
// grows, then the instance can change
multiplyIdToStorage(storage.getBitArray(), idx, x, y, z);
} }
} }
return storage; return storage;