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; import java.util.Random;
public class BCLBiome { 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 final ResourceLocation mcID;
protected BCLBiome edge; protected final float terrainHeight;
protected int edgeSize;
protected BCLBiome biomeParent;
protected float maxSubBiomeChance = 1;
protected final float genChance; protected final float genChance;
protected final Biome biome;
private final Map<String, Object> customData; private final Map<String, Object> customData;
private final float fogDensity; private final float fogDensity;
protected BCLBiome biomeParent;
protected BCLBiome edge;
protected int edgeSize;
private BCLFeature structuresFeature; private BCLFeature structuresFeature;
private Biome actualBiome; private Biome actualBiome;
@ -51,6 +52,7 @@ public class BCLBiome {
this.genChance = definition.getGenChance(); this.genChance = definition.getGenChance();
this.fogDensity = definition.getFodDensity(); this.fogDensity = definition.getFodDensity();
this.customData = definition.getCustomData(); this.customData = definition.getCustomData();
this.terrainHeight = definition.getTerrainHeight();
subbiomes.add(this, 1); subbiomes.add(this, 1);
} }
@ -68,6 +70,7 @@ public class BCLBiome {
} }
this.readStructureList(); this.readStructureList();
this.customData = Maps.newHashMap(); this.customData = Maps.newHashMap();
this.terrainHeight = 0.1F;
subbiomes.add(this, 1); subbiomes.add(this, 1);
} }
@ -210,4 +213,8 @@ public class BCLBiome {
public void addCustomData(String name, Object obj) { public void addCustomData(String name, Object obj) {
customData.put(name, 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 fogColor = 10518688;
private int skyColor = 0; private int skyColor = 0;
private float fogDensity = 1F; private float fogDensity = 1F;
private float depth = 0.1F; private float terrainHeight = 0.1F;
private Precipitation precipitation = Precipitation.NONE; private Precipitation precipitation = Precipitation.NONE;
private BiomeCategory category = BiomeCategory.NONE; private BiomeCategory category = BiomeCategory.NONE;
@ -165,8 +165,8 @@ public class BCLBiomeDef {
return this; return this;
} }
public BCLBiomeDef setDepth(float depth) { public BCLBiomeDef setTerrainHeight(float terrainHeight) {
this.depth = depth; this.terrainHeight = terrainHeight;
return this; return this;
} }
@ -361,6 +361,10 @@ public class BCLBiomeDef {
.build(); .build();
} }
public float getTerrainHeight() {
return terrainHeight;
}
private static final class SpawnInfo { private static final class SpawnInfo {
EntityType<?> type; EntityType<?> type;
int weight; int weight;