Migration to BCLib Biome API (WIP)
This commit is contained in:
parent
0b336febd8
commit
19b175f788
101 changed files with 344 additions and 1497 deletions
|
@ -1,235 +1,20 @@
|
|||
package ru.betterend.world.biome;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.Music;
|
||||
import net.minecraft.sounds.Musics;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.level.biome.AmbientAdditionsSettings;
|
||||
import net.minecraft.world.level.biome.AmbientMoodSettings;
|
||||
import net.minecraft.world.level.biome.AmbientParticleSettings;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biome.BiomeCategory;
|
||||
import net.minecraft.world.level.biome.Biome.Precipitation;
|
||||
import net.minecraft.world.level.biome.BiomeGenerationSettings;
|
||||
import net.minecraft.world.level.biome.BiomeSpecialEffects.Builder;
|
||||
import net.minecraft.world.level.biome.MobSpawnSettings;
|
||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Carving;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.ProbabilityFeatureConfiguration;
|
||||
import net.minecraft.world.level.levelgen.surfacebuilders.ConfiguredSurfaceBuilder;
|
||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilder;
|
||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderBaseConfiguration;
|
||||
import ru.bclib.util.ColorUtil;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.world.features.EndFeature;
|
||||
import ru.betterend.world.structures.EndStructureFeature;
|
||||
import ru.betterend.world.surface.DoubleBlockSurfaceBuilder;
|
||||
import ru.betterend.world.surface.SurfaceBuilders;
|
||||
|
||||
public class BiomeDefinition {
|
||||
private static final int DEF_FOLIAGE = ColorUtil.color(197, 210, 112);
|
||||
|
||||
private final List<ConfiguredStructureFeature<?, ?>> structures = Lists.newArrayList();
|
||||
private final List<FeatureInfo> features = Lists.newArrayList();
|
||||
private final List<CarverInfo> carvers = Lists.newArrayList();
|
||||
private final List<SpawnInfo> mobs = Lists.newArrayList();
|
||||
private final List<SpawnerData> spawns = Lists.newArrayList();
|
||||
|
||||
private AmbientParticleSettings particleConfig;
|
||||
private AmbientAdditionsSettings additions;
|
||||
private AmbientMoodSettings mood;
|
||||
private SoundEvent music;
|
||||
private SoundEvent loop;
|
||||
|
||||
private int waterFogColor = 329011;
|
||||
private int waterColor = 4159204;
|
||||
private int fogColor = 10518688;
|
||||
private int foliageColor = DEF_FOLIAGE;
|
||||
private int grassColor = DEF_FOLIAGE;
|
||||
private float fogDensity = 1F;
|
||||
private float depth = 0.1F;
|
||||
|
||||
private final ResourceLocation id;
|
||||
private float genChance = 1F;
|
||||
public class BiomeDefinition extends BCLBiomeDef {
|
||||
private boolean hasCaves = true;
|
||||
private boolean isCaveBiome = false;
|
||||
private float temperature = 1F;
|
||||
|
||||
private ConfiguredSurfaceBuilder<?> surface;
|
||||
|
||||
public BiomeDefinition(String name) {
|
||||
this.id = BetterEnd.makeID(name);
|
||||
super(BetterEnd.makeID(name));
|
||||
this.endBiome();
|
||||
}
|
||||
|
||||
public BiomeDefinition setCaveBiome() {
|
||||
isCaveBiome = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setSurface(Block block) {
|
||||
setSurface(SurfaceBuilder.DEFAULT.configured(new SurfaceBuilderBaseConfiguration(
|
||||
block.defaultBlockState(),
|
||||
Blocks.END_STONE.defaultBlockState(),
|
||||
Blocks.END_STONE.defaultBlockState()
|
||||
)));
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setSurface(Block block1, Block block2) {
|
||||
setSurface(DoubleBlockSurfaceBuilder.register("be_" + id.getPath() + "_surface").setBlock1(block1).setBlock2(block2).configured());
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setSurface(ConfiguredSurfaceBuilder<?> builder) {
|
||||
this.surface = builder;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setSurface(SurfaceBuilder<SurfaceBuilderBaseConfiguration> builder) {
|
||||
return setSurface(builder.configured(SurfaceBuilders.DEFAULT_END_CONFIG));
|
||||
}
|
||||
|
||||
public BiomeDefinition setParticles(ParticleOptions particle, float probability) {
|
||||
this.particleConfig = new AmbientParticleSettings(particle, probability);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setGenChance(float genChance) {
|
||||
this.genChance = genChance;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setDepth(float depth) {
|
||||
this.depth = depth;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setTemperature(float temperature) {
|
||||
this.temperature = temperature;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition addMobSpawn(EntityType<?> type, int weight, int minGroupSize, int maxGroupSize) {
|
||||
ResourceLocation eID = Registry.ENTITY_TYPE.getKey(type);
|
||||
if (eID != Registry.ENTITY_TYPE.getDefaultKey()) {
|
||||
SpawnInfo info = new SpawnInfo();
|
||||
info.type = type;
|
||||
info.weight = weight;
|
||||
info.minGroupSize = minGroupSize;
|
||||
info.maxGroupSize = maxGroupSize;
|
||||
mobs.add(info);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition addMobSpawn(SpawnerData entry) {
|
||||
spawns.add(entry);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition addStructureFeature(ConfiguredStructureFeature<?, ?> feature) {
|
||||
structures.add(feature);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition addStructureFeature(EndStructureFeature feature) {
|
||||
structures.add(feature.getFeatureConfigured());
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition addFeature(EndFeature feature) {
|
||||
FeatureInfo info = new FeatureInfo();
|
||||
info.featureStep = feature.getFeatureStep();
|
||||
info.feature = feature.getFeatureConfigured();
|
||||
features.add(info);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition addFeature(Decoration featureStep, ConfiguredFeature<?, ?> feature) {
|
||||
FeatureInfo info = new FeatureInfo();
|
||||
info.featureStep = featureStep;
|
||||
info.feature = feature;
|
||||
features.add(info);
|
||||
return this;
|
||||
}
|
||||
|
||||
private int getColor(int r, int g, int b) {
|
||||
r = Mth.clamp(r, 0, 255);
|
||||
g = Mth.clamp(g, 0, 255);
|
||||
b = Mth.clamp(b, 0, 255);
|
||||
return ColorUtil.color(r, g, b);
|
||||
}
|
||||
|
||||
public BiomeDefinition setFogColor(int r, int g, int b) {
|
||||
this.fogColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setFogDensity(float density) {
|
||||
this.fogDensity = density;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setWaterColor(int r, int g, int b) {
|
||||
this.waterColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setWaterFogColor(int r, int g, int b) {
|
||||
this.waterFogColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setWaterAndFogColor(int r, int g, int b) {
|
||||
return setWaterColor(r, g, b).setWaterFogColor(r, g, b);
|
||||
}
|
||||
|
||||
public BiomeDefinition setFoliageColor(int r, int g, int b) {
|
||||
this.foliageColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setGrassColor(int r, int g, int b) {
|
||||
this.grassColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setPlantsColor(int r, int g, int b) {
|
||||
return this.setFoliageColor(r, g, b).setGrassColor(r, g, b);
|
||||
}
|
||||
|
||||
public BiomeDefinition setLoop(SoundEvent loop) {
|
||||
this.loop = loop;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setMood(SoundEvent mood) {
|
||||
this.mood = new AmbientMoodSettings(mood, 6000, 8, 2.0D);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setAdditions(SoundEvent additions) {
|
||||
this.additions = new AmbientAdditionsSettings(additions, 0.0111);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setMusic(SoundEvent music) {
|
||||
this.music = music;
|
||||
this.setCategory(BiomeCategory.NONE);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -238,83 +23,11 @@ public class BiomeDefinition {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Biome build() {
|
||||
MobSpawnSettings.Builder spawnSettings = new MobSpawnSettings.Builder();
|
||||
BiomeGenerationSettings.Builder generationSettings = new BiomeGenerationSettings.Builder();
|
||||
Builder effects = new Builder();
|
||||
|
||||
mobs.forEach((spawn) -> {
|
||||
spawnSettings.addSpawn(spawn.type.getCategory(), new MobSpawnSettings.SpawnerData(spawn.type, spawn.weight, spawn.minGroupSize, spawn.maxGroupSize));
|
||||
});
|
||||
|
||||
spawns.forEach((entry) -> {
|
||||
spawnSettings.addSpawn(entry.type.getCategory(), entry);
|
||||
});
|
||||
|
||||
EndFeatures.addDefaultFeatures(this);
|
||||
generationSettings.surfaceBuilder(surface == null ? net.minecraft.data.worldgen.SurfaceBuilders.END : surface);
|
||||
structures.forEach((structure) -> generationSettings.addStructureStart(structure));
|
||||
features.forEach((info) -> generationSettings.addFeature(info.featureStep, info.feature));
|
||||
carvers.forEach((info) -> generationSettings.addCarver(info.carverStep, info.carver));
|
||||
|
||||
effects.skyColor(0).waterColor(waterColor).waterFogColor(waterFogColor).fogColor(fogColor).foliageColorOverride(foliageColor).grassColorOverride(grassColor);
|
||||
if (loop != null) effects.ambientLoopSound(loop);
|
||||
if (mood != null) effects.ambientMoodSound(mood);
|
||||
if (additions != null) effects.ambientAdditionsSound(additions);
|
||||
if (particleConfig != null) effects.ambientParticle(particleConfig);
|
||||
effects.backgroundMusic(music != null ? new Music(music, 600, 2400, true) : Musics.END);
|
||||
|
||||
return new Biome.BiomeBuilder()
|
||||
.precipitation(Precipitation.NONE)
|
||||
.biomeCategory(isCaveBiome ? BiomeCategory.NONE : BiomeCategory.THEEND)
|
||||
.depth(depth)
|
||||
.scale(0.2F)
|
||||
.temperature(temperature)
|
||||
.downfall(0.0F)
|
||||
.specialEffects(effects.build())
|
||||
.mobSpawnSettings(spawnSettings.build())
|
||||
.generationSettings(generationSettings.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
private static final class SpawnInfo {
|
||||
EntityType<?> type;
|
||||
int weight;
|
||||
int minGroupSize;
|
||||
int maxGroupSize;
|
||||
}
|
||||
|
||||
private static final class FeatureInfo {
|
||||
Decoration featureStep;
|
||||
ConfiguredFeature<?, ?> feature;
|
||||
}
|
||||
|
||||
private static final class CarverInfo {
|
||||
Carving carverStep;
|
||||
ConfiguredWorldCarver<ProbabilityFeatureConfiguration> carver;
|
||||
}
|
||||
|
||||
public ResourceLocation getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public float getFodDensity() {
|
||||
return fogDensity;
|
||||
}
|
||||
|
||||
public float getGenChance() {
|
||||
return genChance;
|
||||
}
|
||||
|
||||
public boolean hasCaves() {
|
||||
return hasCaves;
|
||||
}
|
||||
|
||||
public BiomeDefinition addCarver(Carving carverStep, ConfiguredWorldCarver<ProbabilityFeatureConfiguration> carver) {
|
||||
CarverInfo info = new CarverInfo();
|
||||
info.carverStep = carverStep;
|
||||
info.carver = carver;
|
||||
carvers.add(info);
|
||||
return this;
|
||||
public BCLBiomeDef addStructureFeature(EndStructureFeature structure) {
|
||||
return addStructureFeature(structure.getFeatureConfigured());
|
||||
}
|
||||
}
|
|
@ -1,211 +1,24 @@
|
|||
package ru.betterend.world.biome;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import ru.bclib.util.JsonFactory;
|
||||
import ru.bclib.util.StructureHelper;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
import ru.betterend.config.Configs;
|
||||
import ru.betterend.world.features.EndFeature;
|
||||
import ru.betterend.world.features.ListFeature;
|
||||
import ru.betterend.world.features.ListFeature.StructureInfo;
|
||||
import ru.betterend.world.features.NBTStructureFeature.TerrainMerge;
|
||||
|
||||
public class EndBiome {
|
||||
protected List<EndBiome> subbiomes = Lists.newArrayList();
|
||||
|
||||
protected final Biome biome;
|
||||
protected final ResourceLocation mcID;
|
||||
protected EndBiome edge;
|
||||
protected int edgeSize;
|
||||
|
||||
protected EndBiome biomeParent;
|
||||
protected float maxSubBiomeChance = 1;
|
||||
protected final float genChanceUnmutable;
|
||||
protected float genChance = 1;
|
||||
|
||||
private final float fogDensity;
|
||||
public class EndBiome extends BCLBiome {
|
||||
private final boolean hasCaves;
|
||||
private EndFeature structuresFeature;
|
||||
private Biome actualBiome;
|
||||
|
||||
|
||||
public EndBiome(BiomeDefinition definition) {
|
||||
this.mcID = definition.getID();
|
||||
this.readStructureList();
|
||||
if (structuresFeature != null) {
|
||||
definition.addFeature(structuresFeature);
|
||||
}
|
||||
this.biome = definition.build();
|
||||
this.fogDensity = Configs.BIOME_CONFIG.getFloat(mcID, "fog_density", definition.getFodDensity());
|
||||
this.genChanceUnmutable = Configs.BIOME_CONFIG.getFloat(mcID, "generation_chance", definition.getGenChance());
|
||||
super(definition.loadConfigValues(Configs.BIOME_CONFIG));
|
||||
this.hasCaves = Configs.BIOME_CONFIG.getBoolean(mcID, "has_caves", definition.hasCaves());
|
||||
this.edgeSize = Configs.BIOME_CONFIG.getInt(mcID, "edge_size", 32);
|
||||
}
|
||||
|
||||
public EndBiome(ResourceLocation id, Biome biome, float fogDensity, float genChance, boolean hasCaves) {
|
||||
this.mcID = id;
|
||||
this.readStructureList();
|
||||
this.biome = biome;
|
||||
this.fogDensity = Configs.BIOME_CONFIG.getFloat(mcID, "fog_density", fogDensity);
|
||||
this.genChanceUnmutable = Configs.BIOME_CONFIG.getFloat(mcID, "generation_chance", genChance);
|
||||
super(id, biome, fogDensity, genChance);
|
||||
this.hasCaves = Configs.BIOME_CONFIG.getBoolean(mcID, "has_caves", hasCaves);
|
||||
this.edgeSize = Configs.BIOME_CONFIG.getInt(mcID, "edge_size", 32);
|
||||
}
|
||||
|
||||
public EndBiome getEdge() {
|
||||
return edge == null ? this : edge;
|
||||
}
|
||||
|
||||
public void setEdge(EndBiome edge) {
|
||||
this.edge = edge;
|
||||
edge.biomeParent = this;
|
||||
}
|
||||
|
||||
public int getEdgeSize() {
|
||||
return edgeSize;
|
||||
}
|
||||
|
||||
public void setEdgeSize(int size) {
|
||||
edgeSize = size;
|
||||
}
|
||||
|
||||
public void addSubBiome(EndBiome biome) {
|
||||
maxSubBiomeChance += biome.mutateGenChance(maxSubBiomeChance);
|
||||
biome.biomeParent = this;
|
||||
subbiomes.add(biome);
|
||||
}
|
||||
|
||||
public boolean containsSubBiome(EndBiome biome) {
|
||||
return subbiomes.contains(biome);
|
||||
}
|
||||
|
||||
public EndBiome getSubBiome(Random random) {
|
||||
float chance = random.nextFloat() * maxSubBiomeChance;
|
||||
for (EndBiome biome : subbiomes)
|
||||
if (biome.canGenerate(chance))
|
||||
return biome;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EndBiome getParentBiome() {
|
||||
return this.biomeParent;
|
||||
}
|
||||
|
||||
public boolean hasEdge() {
|
||||
return edge != null;
|
||||
}
|
||||
|
||||
public boolean hasParentBiome() {
|
||||
return biomeParent != null;
|
||||
}
|
||||
|
||||
public boolean isSame(EndBiome biome) {
|
||||
return biome == this || (biome.hasParentBiome() && biome.getParentBiome() == this);
|
||||
}
|
||||
|
||||
public boolean canGenerate(float chance) {
|
||||
return chance <= this.genChance;
|
||||
}
|
||||
|
||||
public float mutateGenChance(float chance) {
|
||||
genChance = genChanceUnmutable;
|
||||
genChance += chance;
|
||||
return genChance;
|
||||
}
|
||||
|
||||
public Biome getBiome() {
|
||||
return biome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return mcID.toString();
|
||||
}
|
||||
|
||||
public ResourceLocation getID() {
|
||||
return mcID;
|
||||
}
|
||||
|
||||
public float getFogDensity() {
|
||||
return fogDensity;
|
||||
}
|
||||
|
||||
protected void readStructureList() {
|
||||
String ns = mcID.getNamespace();
|
||||
String nm = mcID.getPath();
|
||||
|
||||
String path = "/data/" + ns + "/structures/biome/" + nm + "/";
|
||||
InputStream inputstream = StructureHelper.class.getResourceAsStream(path + "structures.json");
|
||||
if (inputstream != null) {
|
||||
JsonObject obj = JsonFactory.getJsonObject(inputstream);
|
||||
JsonArray enties = obj.getAsJsonArray("structures");
|
||||
if (enties != null) {
|
||||
List<StructureInfo> list = Lists.newArrayList();
|
||||
enties.forEach((entry) -> {
|
||||
JsonObject e = entry.getAsJsonObject();
|
||||
String structure = path + e.get("nbt").getAsString() + ".nbt";
|
||||
TerrainMerge terrainMerge = TerrainMerge.getFromString(e.get("terrainMerge").getAsString());
|
||||
int offsetY = e.get("offsetY").getAsInt();
|
||||
list.add(new StructureInfo(structure, offsetY, terrainMerge));
|
||||
});
|
||||
if (!list.isEmpty()) {
|
||||
structuresFeature = EndFeature.makeChansedFeature(nm + "_structures", new ListFeature(list), 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public EndFeature getStructuresFeature() {
|
||||
return structuresFeature;
|
||||
}
|
||||
|
||||
public Biome getActualBiome() {
|
||||
return this.actualBiome;
|
||||
}
|
||||
|
||||
public float getGenChance() {
|
||||
return this.genChance;
|
||||
}
|
||||
|
||||
public float getGenChanceImmutable() {
|
||||
return this.genChanceUnmutable;
|
||||
}
|
||||
|
||||
public boolean hasCaves() {
|
||||
return hasCaves;
|
||||
}
|
||||
|
||||
public void updateActualBiomes(Registry<Biome> biomeRegistry) {
|
||||
subbiomes.forEach((sub) -> {
|
||||
if (sub != this) {
|
||||
sub.updateActualBiomes(biomeRegistry);
|
||||
}
|
||||
});
|
||||
if (edge != null && edge != this) {
|
||||
edge.updateActualBiomes(biomeRegistry);
|
||||
}
|
||||
this.actualBiome = biomeRegistry.get(mcID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
EndBiome biome = (EndBiome) obj;
|
||||
return biome == null ? false : biome.mcID.equals(mcID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return mcID.hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,15 +9,15 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class BiomeIceStarfield extends EndBiome {
|
||||
public BiomeIceStarfield() {
|
||||
super(new BiomeDefinition("ice_starfield")
|
||||
super((BiomeDefinition) new BiomeDefinition("ice_starfield")
|
||||
.setCaves(false)
|
||||
.addStructureFeature(EndStructures.GIANT_ICE_STAR)
|
||||
.setFogColor(224, 245, 254)
|
||||
.setTemperature(0F)
|
||||
.setFogDensity(2.2F)
|
||||
.setFoliageColor(193, 244, 244)
|
||||
.setGenChance(0.25F)
|
||||
.setCaves(false)
|
||||
.setParticles(EndParticles.SNOWFLAKE, 0.002F)
|
||||
.addStructureFeature(EndStructures.GIANT_ICE_STAR)
|
||||
.addFeature(EndFeatures.ICE_STAR)
|
||||
.addFeature(EndFeatures.ICE_STAR_SMALL)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 20, 1, 4));
|
||||
|
|
|
@ -6,7 +6,7 @@ import ru.betterend.world.biome.BiomeDefinition;
|
|||
|
||||
public class EmptyAuroraCaveBiome extends EndCaveBiome {
|
||||
public EmptyAuroraCaveBiome() {
|
||||
super(new BiomeDefinition("empty_aurora_cave")
|
||||
super((BiomeDefinition) new BiomeDefinition("empty_aurora_cave")
|
||||
.setFogColor(150, 30, 68)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(108, 25, 46)
|
||||
|
|
|
@ -5,7 +5,7 @@ import ru.betterend.world.biome.BiomeDefinition;
|
|||
|
||||
public class EmptyEndCaveBiome extends EndCaveBiome {
|
||||
public EmptyEndCaveBiome() {
|
||||
super(new BiomeDefinition("empty_end_cave").setFogDensity(2.0F));
|
||||
super((BiomeDefinition) new BiomeDefinition("empty_end_cave").setFogDensity(2.0F));
|
||||
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1);
|
||||
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import ru.betterend.world.biome.BiomeDefinition;
|
|||
|
||||
public class EmptySmaragdantCaveBiome extends EndCaveBiome {
|
||||
public EmptySmaragdantCaveBiome() {
|
||||
super(new BiomeDefinition("empty_smaragdant_cave")
|
||||
super((BiomeDefinition) new BiomeDefinition("empty_smaragdant_cave")
|
||||
.setFogColor(0, 253, 182)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(0, 131, 145)
|
||||
|
|
|
@ -6,11 +6,12 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.entity.ai.behavior.WeightedList;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.world.features.BCLFeature;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.BiomeDefinition;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
import ru.betterend.world.features.EndFeature;
|
||||
import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature;
|
||||
|
||||
public class EndCaveBiome extends EndBiome {
|
||||
|
@ -22,11 +23,11 @@ public class EndCaveBiome extends EndBiome {
|
|||
}
|
||||
|
||||
private static BiomeDefinition makeDef(BiomeDefinition definition) {
|
||||
EndFeature feature = EndFeature.makeChunkFeature(
|
||||
definition.getID().getPath() + "_cave_populator",
|
||||
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) EndBiomes.getBiome(definition.getID()))
|
||||
BCLFeature feature = BCLFeature.makeChunkFeature(
|
||||
BetterEnd.makeID(definition.getID().getPath() + "_cave_populator"),
|
||||
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID()))
|
||||
);
|
||||
definition.addFeature(feature).setCaveBiome();
|
||||
definition.setCaveBiome().addFeature(feature);
|
||||
definition.setMusic(EndSounds.MUSIC_CAVES);
|
||||
definition.setLoop(EndSounds.AMBIENT_CAVES);
|
||||
return definition;
|
||||
|
|
|
@ -13,7 +13,7 @@ public class JadeCaveBiome extends EndCaveBiome {
|
|||
private static final BlockState[] JADE = new BlockState[3];
|
||||
|
||||
public JadeCaveBiome() {
|
||||
super(new BiomeDefinition("jade_cave")
|
||||
super((BiomeDefinition) new BiomeDefinition("jade_cave")
|
||||
.setFogColor(118, 150, 112)
|
||||
.setFogDensity(2.0F)
|
||||
.setWaterAndFogColor(95, 223, 255)
|
||||
|
|
|
@ -11,7 +11,7 @@ import ru.betterend.world.biome.BiomeDefinition;
|
|||
|
||||
public class LushAuroraCaveBiome extends EndCaveBiome {
|
||||
public LushAuroraCaveBiome() {
|
||||
super(new BiomeDefinition("lush_aurora_cave")
|
||||
super((BiomeDefinition) new BiomeDefinition("lush_aurora_cave")
|
||||
.setFogColor(150, 30, 68)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(108, 25, 46)
|
||||
|
|
|
@ -7,7 +7,7 @@ import ru.betterend.world.biome.BiomeDefinition;
|
|||
|
||||
public class LushSmaragdantCaveBiome extends EndCaveBiome {
|
||||
public LushSmaragdantCaveBiome() {
|
||||
super(new BiomeDefinition("lush_smaragdant_cave")
|
||||
super((BiomeDefinition) new BiomeDefinition("lush_smaragdant_cave")
|
||||
.setFogColor(0, 253, 182)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(0, 131, 145)
|
||||
|
|
|
@ -12,7 +12,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class AmberLandBiome extends EndBiome {
|
||||
public AmberLandBiome() {
|
||||
super(new BiomeDefinition("amber_land")
|
||||
super((BiomeDefinition) new BiomeDefinition("amber_land")
|
||||
.setFogColor(255, 184, 71)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(219, 115, 38)
|
||||
|
|
|
@ -10,11 +10,11 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class BlossomingSpiresBiome extends EndBiome {
|
||||
public BlossomingSpiresBiome() {
|
||||
super(new BiomeDefinition("blossoming_spires")
|
||||
super((BiomeDefinition) new BiomeDefinition("blossoming_spires")
|
||||
.setCaves(false)
|
||||
.setFogColor(241, 146, 229)
|
||||
.setFogDensity(1.7F)
|
||||
.setPlantsColor(122, 45, 122)
|
||||
.setCaves(false)
|
||||
.setSurface(EndBlocks.PINK_MOSS)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
|
||||
|
|
|
@ -14,7 +14,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class ChorusForestBiome extends EndBiome {
|
||||
public ChorusForestBiome() {
|
||||
super(new BiomeDefinition("chorus_forest")
|
||||
super((BiomeDefinition) new BiomeDefinition("chorus_forest")
|
||||
.setFogColor(87, 26, 87)
|
||||
.setFogDensity(1.5F)
|
||||
.setPlantsColor(122, 45, 122)
|
||||
|
|
|
@ -10,11 +10,11 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class CrystalMountainsBiome extends EndBiome {
|
||||
public CrystalMountainsBiome() {
|
||||
super(new BiomeDefinition("crystal_mountains")
|
||||
super((BiomeDefinition) new BiomeDefinition("crystal_mountains")
|
||||
.addStructureFeature(EndStructures.MOUNTAIN)
|
||||
.setPlantsColor(255, 133, 211)
|
||||
.setSurface(EndBlocks.CRYSTAL_MOSS)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.addStructureFeature(EndStructures.MOUNTAIN)
|
||||
.addFeature(EndFeatures.ROUND_CAVE)
|
||||
.addFeature(EndFeatures.CRYSTAL_GRASS)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
|
|
|
@ -10,7 +10,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class DragonGraveyardsBiome extends EndBiome {
|
||||
public DragonGraveyardsBiome() {
|
||||
super(new BiomeDefinition("dragon_graveyards")
|
||||
super((BiomeDefinition) new BiomeDefinition("dragon_graveyards")
|
||||
.setGenChance(0.1F)
|
||||
.setFogColor(244, 46, 79)
|
||||
.setFogDensity(1.3F)
|
||||
|
|
|
@ -10,7 +10,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class DryShrublandBiome extends EndBiome {
|
||||
public DryShrublandBiome() {
|
||||
super(new BiomeDefinition("dry_shrubland")
|
||||
super((BiomeDefinition) new BiomeDefinition("dry_shrubland")
|
||||
.setFogColor(132, 35, 13)
|
||||
.setFogDensity(1.2F)
|
||||
.setWaterAndFogColor(113, 88, 53)
|
||||
|
|
|
@ -10,7 +10,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class DustWastelandsBiome extends EndBiome {
|
||||
public DustWastelandsBiome() {
|
||||
super(new BiomeDefinition("dust_wastelands")
|
||||
super((BiomeDefinition) new BiomeDefinition("dust_wastelands")
|
||||
.setFogColor(226, 239, 168)
|
||||
.setFogDensity(2)
|
||||
.setWaterAndFogColor(192, 180, 131)
|
||||
|
|
|
@ -13,7 +13,8 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class FoggyMushroomlandBiome extends EndBiome {
|
||||
public FoggyMushroomlandBiome() {
|
||||
super(new BiomeDefinition("foggy_mushroomland")
|
||||
super((BiomeDefinition) new BiomeDefinition("foggy_mushroomland")
|
||||
.addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM)
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(41, 122, 173)
|
||||
.setFogDensity(3)
|
||||
|
@ -22,7 +23,6 @@ public class FoggyMushroomlandBiome extends EndBiome {
|
|||
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM)
|
||||
.addFeature(EndFeatures.END_LAKE)
|
||||
.addFeature(EndFeatures.MOSSY_GLOWSHROOM)
|
||||
.addFeature(EndFeatures.BLUE_VINE)
|
||||
|
|
|
@ -11,7 +11,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class GlowingGrasslandsBiome extends EndBiome {
|
||||
public GlowingGrasslandsBiome() {
|
||||
super(new BiomeDefinition("glowing_grasslands")
|
||||
super((BiomeDefinition) new BiomeDefinition("glowing_grasslands")
|
||||
.setFogColor(99, 228, 247)
|
||||
.setFogDensity(1.3F)
|
||||
.setParticles(EndParticles.FIREFLY, 0.001F)
|
||||
|
|
|
@ -11,7 +11,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class LanternWoodsBiome extends EndBiome {
|
||||
public LanternWoodsBiome() {
|
||||
super(new BiomeDefinition("lantern_woods")
|
||||
super((BiomeDefinition) new BiomeDefinition("lantern_woods")
|
||||
.setFogColor(189, 82, 70)
|
||||
.setFogDensity(1.1F)
|
||||
.setWaterAndFogColor(171, 234, 226)
|
||||
|
|
|
@ -11,7 +11,8 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class MegalakeBiome extends EndBiome {
|
||||
public MegalakeBiome() {
|
||||
super(new BiomeDefinition("megalake")
|
||||
super((BiomeDefinition) new BiomeDefinition("megalake")
|
||||
.addStructureFeature(EndStructures.MEGALAKE)
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(178, 209, 248)
|
||||
.setWaterAndFogColor(96, 163, 255)
|
||||
|
@ -20,7 +21,6 @@ public class MegalakeBiome extends EndBiome {
|
|||
.setLoop(EndSounds.AMBIENT_MEGALAKE)
|
||||
.setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST)
|
||||
.setDepth(0F)
|
||||
.addStructureFeature(EndStructures.MEGALAKE)
|
||||
.addFeature(EndFeatures.END_LOTUS)
|
||||
.addFeature(EndFeatures.END_LOTUS_LEAF)
|
||||
.addFeature(EndFeatures.BUBBLE_CORAL_RARE)
|
||||
|
|
|
@ -12,7 +12,8 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class MegalakeGroveBiome extends EndBiome {
|
||||
public MegalakeGroveBiome() {
|
||||
super(new BiomeDefinition("megalake_grove")
|
||||
super((BiomeDefinition) new BiomeDefinition("megalake_grove")
|
||||
.addStructureFeature(EndStructures.MEGALAKE_SMALL)
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(178, 209, 248)
|
||||
.setWaterAndFogColor(96, 163, 255)
|
||||
|
@ -22,7 +23,6 @@ public class MegalakeGroveBiome extends EndBiome {
|
|||
.setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE)
|
||||
.setSurface(EndBlocks.END_MOSS)
|
||||
.setDepth(0F)
|
||||
.addStructureFeature(EndStructures.MEGALAKE_SMALL)
|
||||
.addFeature(EndFeatures.LACUGROVE)
|
||||
.addFeature(EndFeatures.END_LOTUS)
|
||||
.addFeature(EndFeatures.END_LOTUS_LEAF)
|
||||
|
|
|
@ -11,7 +11,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class NeonOasisBiome extends EndBiome {
|
||||
public NeonOasisBiome() {
|
||||
super(new BiomeDefinition("neon_oasis")
|
||||
super((BiomeDefinition) new BiomeDefinition("neon_oasis")
|
||||
.setGenChance(0.5F)
|
||||
.setFogColor(226, 239, 168)
|
||||
.setFogDensity(2)
|
||||
|
|
|
@ -10,7 +10,8 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class PaintedMountainsBiome extends EndBiome {
|
||||
public PaintedMountainsBiome() {
|
||||
super(new BiomeDefinition("painted_mountains")
|
||||
super((BiomeDefinition) new BiomeDefinition("painted_mountains")
|
||||
.addStructureFeature(EndStructures.PAINTED_MOUNTAIN)
|
||||
.setFogColor(226, 239, 168)
|
||||
.setFogDensity(2)
|
||||
.setWaterAndFogColor(192, 180, 131)
|
||||
|
@ -18,7 +19,6 @@ public class PaintedMountainsBiome extends EndBiome {
|
|||
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.setSurface(EndBlocks.ENDSTONE_DUST)
|
||||
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
|
||||
.addStructureFeature(EndStructures.PAINTED_MOUNTAIN)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class ShadowForestBiome extends EndBiome {
|
||||
public ShadowForestBiome() {
|
||||
super(new BiomeDefinition("shadow_forest")
|
||||
super((BiomeDefinition) new BiomeDefinition("shadow_forest")
|
||||
.setFogColor(0, 0, 0)
|
||||
.setFogDensity(2.5F)
|
||||
.setPlantsColor(45, 45, 45)
|
||||
|
|
|
@ -11,15 +11,15 @@ import ru.betterend.world.surface.SurfaceBuilders;
|
|||
|
||||
public class SulphurSpringsBiome extends EndBiome {
|
||||
public SulphurSpringsBiome() {
|
||||
super(new BiomeDefinition("sulphur_springs")
|
||||
.setSurface(SurfaceBuilders.SULPHURIC_SURFACE)
|
||||
super((BiomeDefinition) new BiomeDefinition("sulphur_springs")
|
||||
.setCaves(false)
|
||||
.setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS)
|
||||
.setWaterColor(25, 90, 157)
|
||||
.setWaterFogColor(30, 65, 61)
|
||||
.setFogColor(207, 194, 62)
|
||||
.setFogDensity(1.5F)
|
||||
.setCaves(false)
|
||||
.setDepth(0F)
|
||||
.setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F)
|
||||
.addFeature(EndFeatures.GEYSER)
|
||||
|
|
|
@ -11,7 +11,7 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
public class UmbrellaJungleBiome extends EndBiome {
|
||||
public UmbrellaJungleBiome() {
|
||||
super(new BiomeDefinition("umbrella_jungle")
|
||||
super((BiomeDefinition) new BiomeDefinition("umbrella_jungle")
|
||||
.setFogColor(87, 223, 221)
|
||||
.setWaterAndFogColor(119, 198, 253)
|
||||
.setFoliageColor(27, 183, 194)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue