Tets application of surface rules
This commit is contained in:
parent
d09a3a06df
commit
699332600b
2 changed files with 15 additions and 2 deletions
|
@ -529,7 +529,7 @@ public class BCLBiomeBuilder {
|
||||||
|
|
||||||
final T res = biomeConstructor.apply(biomeID, builder.build());
|
final T res = biomeConstructor.apply(biomeID, builder.build());
|
||||||
res.attachedStructures = structures;
|
res.attachedStructures = structures;
|
||||||
surfaceRules.forEach(s -> BiomeAPI.addSurfaceRule(BiomeAPI.getBiomeID(res.getBiome()), s));
|
res.surfaceRules = surfaceRules;
|
||||||
res.setFogDensity(fogDensity);
|
res.setFogDensity(fogDensity);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,10 @@ import net.minecraft.data.BuiltinRegistries;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
|
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ru.bclib.api.biomes.BiomeAPI;
|
||||||
import ru.bclib.util.WeightedList;
|
import ru.bclib.util.WeightedList;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -210,9 +212,15 @@ public class BCLBiome {
|
||||||
* maintains a list of all structures added to this biome, this is automatically set by
|
* maintains a list of all structures added to this biome, this is automatically set by
|
||||||
* {@link ru.bclib.api.biomes.BCLBiomeBuilder}
|
* {@link ru.bclib.api.biomes.BCLBiomeBuilder}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public List<ConfiguredStructureFeature> attachedStructures = null;
|
public List<ConfiguredStructureFeature> attachedStructures = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For internal use only!!!
|
||||||
|
* maintains a list of all structures added to this biome, this is automatically set by
|
||||||
|
* {@link ru.bclib.api.biomes.BCLBiomeBuilder}
|
||||||
|
*/
|
||||||
|
public List<SurfaceRules.RuleSource> surfaceRules = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively update biomes to correct world biome registry instances, for internal usage only.
|
* Recursively update biomes to correct world biome registry instances, for internal usage only.
|
||||||
* @param biomeRegistry {@link Registry} for {@link Biome}.
|
* @param biomeRegistry {@link Registry} for {@link Biome}.
|
||||||
|
@ -227,6 +235,11 @@ public class BCLBiome {
|
||||||
edge.updateActualBiomes(biomeRegistry);
|
edge.updateActualBiomes(biomeRegistry);
|
||||||
}
|
}
|
||||||
this.actualBiome = biomeRegistry.get(biomeID);
|
this.actualBiome = biomeRegistry.get(biomeID);
|
||||||
|
if (this.attachedStructures!=null)
|
||||||
|
attachedStructures.forEach(s -> BiomeAPI.addBiomeStructure(BiomeAPI.getBiomeKey(actualBiome), s));
|
||||||
|
|
||||||
|
if (this.surfaceRules!=null)
|
||||||
|
surfaceRules.forEach(s -> BiomeAPI.addSurfaceRule(biomeID, s));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue