Biome shading fixes for 1.18 (Spigot, Fabric, Forge)

This commit is contained in:
Mike Primm 2021-12-02 22:18:03 -06:00
parent 34ed98637f
commit e4a3179570
9 changed files with 51 additions and 31 deletions

View file

@ -92,9 +92,9 @@ public class BukkitVersionHelperSpigot118 extends BukkitVersionHelper {
return names.toArray(new String[0]);
}
private static Registry<BiomeBase> reg = null;
private static IRegistry<BiomeBase> reg = null;
private static Registry<BiomeBase> getBiomeReg() {
private static IRegistry<BiomeBase> getBiomeReg() {
if (reg == null) {
reg = MinecraftServer.getServer().aV().d(IRegistry.aR);
}
@ -288,6 +288,10 @@ public class BukkitVersionHelperSpigot118 extends BukkitVersionHelper {
}
return null;
}
@Override
public String getBiomeBaseResourceLocsation(Object bb) {
return getBiomeReg().b((BiomeBase)bb).toString();
}
@Override
public Object getUnloadQueue(World world) {

View file

@ -325,7 +325,7 @@ public class MapChunkCache118 extends AbstractMapChunkCache {
bdata = new SimpleBitStorage(bdataPacked.length, 64, bdataPacked);
for (int j = 0; j < 64; j++) {
int b = bdata != null ? bdata.a(j) : 0;
cursect.biomes[j] = b < bpalette.size() ? BiomeMap.byBiomeName(bpalette.j(b)).getBiomeID() : -1;
cursect.biomes[j] = b < bpalette.size() ? BiomeMap.byBiomeResourceLocation(bpalette.j(b)).getBiomeID() : -1;
}
// Favor the Y=64 version
if ((secnum == 4) || (lastsectwithbiome == null)) {