Merge remote-tracking branch 'origin/oldBiomeGen' into 1.18
This commit is contained in:
commit
9a842694dc
2 changed files with 13 additions and 6 deletions
|
@ -455,9 +455,12 @@ public class BiomeAPI {
|
|||
* @param structure {@link ConfiguredStructureFeature} to add.
|
||||
*/
|
||||
public static void addBiomeStructure(Biome biome, ConfiguredStructureFeature structure) {
|
||||
BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE
|
||||
.getResourceKey(structure)
|
||||
.ifPresent(key -> BiomeModifications.addStructure(ctx -> ctx.getBiomeKey().equals(BuiltinRegistries.BIOME.getKey(biome)), key));
|
||||
BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE.getResourceKey(structure)
|
||||
.ifPresent((key)->
|
||||
BiomeModifications.addStructure(
|
||||
(ctx)-> ctx.getBiomeKey().location().equals(BuiltinRegistries.BIOME.getKey(biome)),
|
||||
key
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,6 +27,7 @@ import net.minecraft.world.level.levelgen.carver.CarverConfiguration;
|
|||
import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.config.IdConfig;
|
||||
import ru.bclib.config.PathConfig;
|
||||
import ru.bclib.util.ColorUtil;
|
||||
|
@ -147,12 +148,12 @@ public class BCLBiomeDef {
|
|||
}
|
||||
|
||||
public BCLBiomeDef setSurface(Block block) {
|
||||
|
||||
//TODO: 1.18 add back surface Code
|
||||
return this;
|
||||
}
|
||||
|
||||
public BCLBiomeDef setSurface(Block block1, Block block2) {
|
||||
|
||||
//TODO: 1.18 add back surface Code
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -349,7 +350,7 @@ public class BCLBiomeDef {
|
|||
if (particleConfig != null) effects.ambientParticle(particleConfig);
|
||||
effects.backgroundMusic(music != null ? new Music(music, 600, 2400, true) : Musics.END);
|
||||
|
||||
return new Biome.BiomeBuilder()
|
||||
Biome b = new Biome.BiomeBuilder()
|
||||
.precipitation(precipitation)
|
||||
.biomeCategory(category)
|
||||
//.depth(depth)
|
||||
|
@ -360,6 +361,9 @@ public class BCLBiomeDef {
|
|||
.mobSpawnSettings(spawnSettings.build())
|
||||
.generationSettings(generationSettings.build())
|
||||
.build();
|
||||
|
||||
structures.forEach((structure) -> BiomeAPI.addBiomeStructure(b, structure));
|
||||
return b;
|
||||
}
|
||||
|
||||
public float getTerrainHeight() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue