BCL Biome terrain height (for the End terrain generator)

This commit is contained in:
paulevsGitch 2021-12-01 07:51:03 +03:00
parent 4e1ec1a148
commit 97ba6b4df1
2 changed files with 21 additions and 10 deletions

View file

@ -24,19 +24,20 @@ import java.util.Map;
import java.util.Random;
public class BCLBiome {
protected WeightedList<BCLBiome> subbiomes = new WeightedList<BCLBiome>();
protected WeightedList<BCLBiome> subbiomes = new WeightedList<>();
protected final Biome biome;
protected final ResourceLocation mcID;
protected BCLBiome edge;
protected int edgeSize;
protected BCLBiome biomeParent;
protected float maxSubBiomeChance = 1;
protected final float terrainHeight;
protected final float genChance;
protected final Biome biome;
private final Map<String, Object> customData;
private final float fogDensity;
protected BCLBiome biomeParent;
protected BCLBiome edge;
protected int edgeSize;
private BCLFeature structuresFeature;
private Biome actualBiome;
@ -51,6 +52,7 @@ public class BCLBiome {
this.genChance = definition.getGenChance();
this.fogDensity = definition.getFodDensity();
this.customData = definition.getCustomData();
this.terrainHeight = definition.getTerrainHeight();
subbiomes.add(this, 1);
}
@ -68,6 +70,7 @@ public class BCLBiome {
}
this.readStructureList();
this.customData = Maps.newHashMap();
this.terrainHeight = 0.1F;
subbiomes.add(this, 1);
}
@ -210,4 +213,8 @@ public class BCLBiome {
public void addCustomData(String name, Object obj) {
customData.put(name, obj);
}
public float getTerrainHeight() {
return terrainHeight;
}
}

View file

@ -63,7 +63,7 @@ public class BCLBiomeDef {
private int fogColor = 10518688;
private int skyColor = 0;
private float fogDensity = 1F;
private float depth = 0.1F;
private float terrainHeight = 0.1F;
private Precipitation precipitation = Precipitation.NONE;
private BiomeCategory category = BiomeCategory.NONE;
@ -165,8 +165,8 @@ public class BCLBiomeDef {
return this;
}
public BCLBiomeDef setDepth(float depth) {
this.depth = depth;
public BCLBiomeDef setTerrainHeight(float terrainHeight) {
this.terrainHeight = terrainHeight;
return this;
}
@ -361,6 +361,10 @@ public class BCLBiomeDef {
.build();
}
public float getTerrainHeight() {
return terrainHeight;
}
private static final class SpawnInfo {
EntityType<?> type;
int weight;