This commit is contained in:
Brian Neumann-Fopiano
2026-02-19 19:50:29 -05:00
parent c2c612eb35
commit 1c72d6410f
18 changed files with 1138 additions and 82 deletions
@@ -203,8 +203,15 @@ public class CustomBiomeSource extends BiomeSource {
int blockX = x << 2;
int blockZ = z << 2;
int blockY = (y - engine.getMinHeight()) << 2;
IrisBiome irisBiome = engine.getComplex().getTrueBiomeStream().get(blockX, blockZ);
int blockY = y << 2;
int surfaceY = engine.getComplex().getHeightStream().get(blockX, blockZ).intValue();
boolean underground = blockY <= surfaceY - 2;
IrisBiome irisBiome = underground
? engine.getComplex().getCaveBiomeStream().get(blockX, blockZ)
: engine.getComplex().getTrueBiomeStream().get(blockX, blockZ);
if (irisBiome == null && underground) {
irisBiome = engine.getComplex().getTrueBiomeStream().get(blockX, blockZ);
}
if (irisBiome == null) {
return getFallbackBiome();
}
@@ -226,7 +233,9 @@ public class CustomBiomeSource extends BiomeSource {
return getFallbackBiome();
}
org.bukkit.block.Biome vanillaBiome = irisBiome.getSkyBiome(noiseRng, blockX, blockY, blockZ);
org.bukkit.block.Biome vanillaBiome = underground
? irisBiome.getGroundBiome(noiseRng, blockX, blockY, blockZ)
: irisBiome.getSkyBiome(noiseRng, blockX, blockY, blockZ);
Holder<Biome> holder = NMSBinding.biomeToBiomeBase(biomeRegistry, vanillaBiome);
if (holder != null) {
return holder;