Fixed for strange historical village generation

1) false positives for zero-sized villages in pre 1.10
2) unique village biome check for 1.15 exclusively
This commit is contained in:
Cubitect 2022-06-01 20:30:02 +02:00
parent 9e301ba95b
commit 761b876b2f

View File

@ -1958,14 +1958,34 @@ L_feature:
case Village: case Village:
if (g->mc <= MC_1_17) if (g->mc <= MC_1_17)
{ {
g->entry = &g->ls.layers[L_RIVER_MIX_4]; if (g->mc == MC_1_15)
sampleX = (chunkX << 2) + 2; { // exclusively in MC_1_15, villages used the same biome check
sampleZ = (chunkZ << 2) + 2; // as other structures
g->entry = &g->ls.layers[L_VORONOI_1];
sampleX = (chunkX << 4) + 9;
sampleZ = (chunkZ << 4) + 9;
}
else
{
g->entry = &g->ls.layers[L_RIVER_MIX_4];
sampleX = (chunkX << 2) + 2;
sampleZ = (chunkZ << 2) + 2;
}
id = getBiomeAt(g, 0, sampleX, 0, sampleZ); id = getBiomeAt(g, 0, sampleX, 0, sampleZ);
if (id < 0 || !isViableFeatureBiome(g->mc, structureType, id)) if (id < 0 || !isViableFeatureBiome(g->mc, structureType, id))
goto L_not_viable; goto L_not_viable;
if (flags && (uint32_t) id != flags) if (flags && (uint32_t) id != flags)
goto L_not_viable; goto L_not_viable;
if (g->mc <= MC_1_9)
{ // before MC_1_10 villages did not spread into invalid biomes,
// which could cause them to fail to generate on the first
// check at block (2, 2) in the starting chunk
sampleX = (chunkX << 4) + 2;
sampleZ = (chunkZ << 4) + 2;
id = getBiomeAt(g, 1, sampleX, 0, sampleZ);
if (id < 0 || !isViableFeatureBiome(g->mc, structureType, id))
goto L_not_viable;
}
viable = id; // biome for viablility, useful for further analysis viable = id; // biome for viablility, useful for further analysis
goto L_viable; goto L_viable;
} }