Simplified BCLBiome inheritance, and removed redundant biome configs (replaced by builtin datapack)
This commit is contained in:
parent
b4494faae5
commit
2af0731a81
10 changed files with 52 additions and 108 deletions
|
@ -81,7 +81,7 @@ public class BiomePicker {
|
||||||
|
|
||||||
biomes.forEach(biome -> {
|
biomes.forEach(biome -> {
|
||||||
if (biome.isValid)
|
if (biome.isValid)
|
||||||
list.add(biome, biome.bclBiome.getGenChance());
|
list.add(biome, biome.bclBiome.settings.getGenChance());
|
||||||
});
|
});
|
||||||
//only a single biome, we need to add the edges as well
|
//only a single biome, we need to add the edges as well
|
||||||
if (list.size() == 1) {
|
if (list.size() == 1) {
|
||||||
|
@ -89,7 +89,7 @@ public class BiomePicker {
|
||||||
|
|
||||||
if (biome.getEdge() != null) {
|
if (biome.getEdge() != null) {
|
||||||
float defaultBiomeSize = 128;
|
float defaultBiomeSize = 128;
|
||||||
float edgeSize = (biome.bclBiome.getEdgeSize() * list.getWeight(0)) / defaultBiomeSize;
|
float edgeSize = (biome.bclBiome.settings.getEdgeSize() * list.getWeight(0)) / defaultBiomeSize;
|
||||||
list.add(biome.getEdge(), edgeSize);
|
list.add(biome.getEdge(), edgeSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class MapStack implements BiomeMap {
|
||||||
if (biome == null) {
|
if (biome == null) {
|
||||||
biome = chunks[i].getBiome(x, z);
|
biome = chunks[i].getBiome(x, z);
|
||||||
}
|
}
|
||||||
if (biome.bclBiome.isVertical()) {
|
if (biome.bclBiome.settings.isVertical()) {
|
||||||
biomeMap[x][z] = biome;
|
biomeMap[x][z] = biome;
|
||||||
isNoEmpty = true;
|
isNoEmpty = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,11 +56,11 @@ public class HexBiomeMap implements BiomeMap {
|
||||||
public BiomePicker.ActualBiome getBiome(double x, double y, double z) {
|
public BiomePicker.ActualBiome getBiome(double x, double y, double z) {
|
||||||
BiomePicker.ActualBiome biome = getRawBiome(x, z);
|
BiomePicker.ActualBiome biome = getRawBiome(x, z);
|
||||||
BiomePicker.ActualBiome edge = biome.getEdge();
|
BiomePicker.ActualBiome edge = biome.getEdge();
|
||||||
int size = biome.bclBiome.getEdgeSize();
|
int size = biome.bclBiome.settings.getEdgeSize();
|
||||||
|
|
||||||
if (edge == null && biome.getParentBiome() != null) {
|
if (edge == null && biome.getParentBiome() != null) {
|
||||||
edge = biome.getParentBiome().getEdge();
|
edge = biome.getParentBiome().getEdge();
|
||||||
size = biome.getParentBiome().bclBiome.getEdgeSize();
|
size = biome.getParentBiome().bclBiome.settings.getEdgeSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edge == null) {
|
if (edge == null) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class SquareBiomeMap implements BiomeMap {
|
||||||
search = biome.getParentBiome();
|
search = biome.getParentBiome();
|
||||||
}
|
}
|
||||||
|
|
||||||
int size = search.bclBiome.getEdgeSize();
|
int size = search.bclBiome.settings.getEdgeSize();
|
||||||
boolean edge = !search.isSame(getRawBiome(x + size, z));
|
boolean edge = !search.isSame(getRawBiome(x + size, z));
|
||||||
edge = edge || !search.isSame(getRawBiome(x - size, z));
|
edge = edge || !search.isSame(getRawBiome(x - size, z));
|
||||||
edge = edge || !search.isSame(getRawBiome(x, z + size));
|
edge = edge || !search.isSame(getRawBiome(x, z + size));
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.jetbrains.annotations.Nullable;
|
||||||
* You may use {@link BCLBiome#codecWithSettings(RecordCodecBuilder.Instance)} to create a Codec that includes
|
* You may use {@link BCLBiome#codecWithSettings(RecordCodecBuilder.Instance)} to create a Codec that includes
|
||||||
* all default settings for {@link BCLBiome} as well as additional Data for your specific subclass.
|
* all default settings for {@link BCLBiome} as well as additional Data for your specific subclass.
|
||||||
*/
|
*/
|
||||||
public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
public class BCLBiome implements BiomeData {
|
||||||
public static final Codec<BCLBiome> CODEC = RecordCodecBuilder.create(instance -> codecWithSettings(instance).apply(
|
public static final Codec<BCLBiome> CODEC = RecordCodecBuilder.create(instance -> codecWithSettings(instance).apply(
|
||||||
instance,
|
instance,
|
||||||
BCLBiome::new
|
BCLBiome::new
|
||||||
|
@ -54,27 +54,27 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
private static class CodecAttributes<T extends BCLBiome> {
|
private static class CodecAttributes<T extends BCLBiome> {
|
||||||
public RecordCodecBuilder<T, Float> t0 = Codec.FLOAT.fieldOf("terrainHeight")
|
public RecordCodecBuilder<T, Float> t0 = Codec.FLOAT.fieldOf("terrainHeight")
|
||||||
.orElse(0.1f)
|
.orElse(0.1f)
|
||||||
.forGetter((T o1) -> o1.terrainHeight);
|
.forGetter((T o1) -> o1.settings.terrainHeight);
|
||||||
|
|
||||||
public RecordCodecBuilder<T, Float> t1 = Codec.FLOAT.fieldOf("fogDensity")
|
public RecordCodecBuilder<T, Float> t1 = Codec.FLOAT.fieldOf("fogDensity")
|
||||||
.orElse(1.0f)
|
.orElse(1.0f)
|
||||||
.forGetter((T o1) -> o1.fogDensity);
|
.forGetter((T o1) -> o1.settings.fogDensity);
|
||||||
public RecordCodecBuilder<T, Float> t2 = Codec.FLOAT.fieldOf("genChance")
|
public RecordCodecBuilder<T, Float> t2 = Codec.FLOAT.fieldOf("genChance")
|
||||||
.orElse(1.0f)
|
.orElse(1.0f)
|
||||||
.forGetter((T o1) -> o1.genChance);
|
.forGetter((T o1) -> o1.settings.genChance);
|
||||||
public RecordCodecBuilder<T, Integer> t3 = Codec.INT.fieldOf("edgeSize")
|
public RecordCodecBuilder<T, Integer> t3 = Codec.INT.fieldOf("edgeSize")
|
||||||
.orElse(0)
|
.orElse(0)
|
||||||
.forGetter((T o1) -> o1.edgeSize);
|
.forGetter((T o1) -> o1.settings.edgeSize);
|
||||||
public RecordCodecBuilder<T, Boolean> t4 = Codec.BOOL.fieldOf("vertical")
|
public RecordCodecBuilder<T, Boolean> t4 = Codec.BOOL.fieldOf("vertical")
|
||||||
.orElse(false)
|
.orElse(false)
|
||||||
.forGetter((T o1) -> o1.vertical);
|
.forGetter((T o1) -> o1.settings.vertical);
|
||||||
public RecordCodecBuilder<T, Optional<ResourceLocation>> t5 =
|
public RecordCodecBuilder<T, Optional<ResourceLocation>> t5 =
|
||||||
ResourceLocation.CODEC
|
ResourceLocation.CODEC
|
||||||
.optionalFieldOf("edge")
|
.optionalFieldOf("edge")
|
||||||
.orElse(Optional.empty())
|
.orElse(Optional.empty())
|
||||||
.forGetter((T o1) -> o1.edge == null
|
.forGetter((T o1) -> ((BCLBiome) o1).edge == null
|
||||||
? Optional.empty()
|
? Optional.empty()
|
||||||
: Optional.of(o1.edge));
|
: Optional.of(((BCLBiome) o1).edge));
|
||||||
public RecordCodecBuilder<T, ResourceLocation> t6 =
|
public RecordCodecBuilder<T, ResourceLocation> t6 =
|
||||||
ResourceLocation.CODEC.fieldOf("biome")
|
ResourceLocation.CODEC.fieldOf("biome")
|
||||||
.forGetter((T o) -> ((BCLBiome) o).biomeID);
|
.forGetter((T o) -> ((BCLBiome) o).biomeID);
|
||||||
|
@ -150,6 +150,7 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
return instance.group(a.t0, a.t1, a.t2, a.t3, a.t4, a.t5, a.t6, a.t7, a.t8, a.t10);
|
return instance.group(a.t0, a.t1, a.t2, a.t3, a.t4, a.t5, a.t6, a.t7, a.t8, a.t10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final BCLBiomeSettings settings;
|
||||||
private final Map<String, Object> customData = Maps.newHashMap();
|
private final Map<String, Object> customData = Maps.newHashMap();
|
||||||
private final ResourceLocation biomeID;
|
private final ResourceLocation biomeID;
|
||||||
private final ResourceKey<Biome> biomeKey;
|
private final ResourceKey<Biome> biomeKey;
|
||||||
|
@ -157,6 +158,7 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
protected final List<Climate.ParameterPoint> parameterPoints = Lists.newArrayList();
|
protected final List<Climate.ParameterPoint> parameterPoints = Lists.newArrayList();
|
||||||
|
|
||||||
private ResourceLocation biomeParent;
|
private ResourceLocation biomeParent;
|
||||||
|
private ResourceLocation edge;
|
||||||
|
|
||||||
private BiomeAPI.BiomeType intendedType = BiomeAPI.BiomeType.NONE;
|
private BiomeAPI.BiomeType intendedType = BiomeAPI.BiomeType.NONE;
|
||||||
|
|
||||||
|
@ -172,7 +174,14 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
Optional<ResourceLocation> biomeParent,
|
Optional<ResourceLocation> biomeParent,
|
||||||
Optional<String> intendedType
|
Optional<String> intendedType
|
||||||
) {
|
) {
|
||||||
super(terrainHeight, fogDensity, genChance, edgeSize, vertical, edge.orElse(null));
|
this.settings = new BCLBiomeSettings(
|
||||||
|
terrainHeight,
|
||||||
|
fogDensity,
|
||||||
|
genChance,
|
||||||
|
edgeSize,
|
||||||
|
vertical
|
||||||
|
);
|
||||||
|
this.edge = edge.orElse(null);
|
||||||
this.biomeID = biomeID;
|
this.biomeID = biomeID;
|
||||||
this.biomeKey = ResourceKey.create(Registries.BIOME, biomeID);
|
this.biomeKey = ResourceKey.create(Registries.BIOME, biomeID);
|
||||||
this.biomeParent = biomeParent.orElse(null);
|
this.biomeParent = biomeParent.orElse(null);
|
||||||
|
@ -216,12 +225,9 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
* @param defaults The Settings for this Biome or null if you want to apply the defaults
|
* @param defaults The Settings for this Biome or null if you want to apply the defaults
|
||||||
*/
|
*/
|
||||||
protected BCLBiome(ResourceKey<Biome> biomeKey, BCLBiomeSettings defaults) {
|
protected BCLBiome(ResourceKey<Biome> biomeKey, BCLBiomeSettings defaults) {
|
||||||
|
this.settings = defaults;
|
||||||
this.biomeID = biomeKey.location();
|
this.biomeID = biomeKey.location();
|
||||||
this.biomeKey = biomeKey;
|
this.biomeKey = biomeKey;
|
||||||
|
|
||||||
if (defaults != null) {
|
|
||||||
defaults.applyWithDefaults(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -231,12 +237,9 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
* @param defaults The Settings for this Biome or null if you want to apply the defaults
|
* @param defaults The Settings for this Biome or null if you want to apply the defaults
|
||||||
*/
|
*/
|
||||||
protected BCLBiome(ResourceLocation biomeID, BCLBiomeSettings defaults) {
|
protected BCLBiome(ResourceLocation biomeID, BCLBiomeSettings defaults) {
|
||||||
|
this.settings = defaults;
|
||||||
this.biomeID = biomeID;
|
this.biomeID = biomeID;
|
||||||
this.biomeKey = ResourceKey.create(Registries.BIOME, biomeID);
|
this.biomeKey = ResourceKey.create(Registries.BIOME, biomeID);
|
||||||
|
|
||||||
if (defaults != null) {
|
|
||||||
defaults.applyWithDefaults(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -272,20 +275,14 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
return !BCLBiomeRegistry.isEmptyBiome(edge);
|
return !BCLBiomeRegistry.isEmptyBiome(edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set biome edge for this biome instance.
|
|
||||||
*
|
|
||||||
* @param edge {@link BCLBiome} as the edge biome.
|
|
||||||
* @return same {@link BCLBiome}.
|
|
||||||
*/
|
|
||||||
BCLBiome setEdgeID(ResourceLocation edge) {
|
|
||||||
this.edge = edge;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
BCLBiome setEdge(BCLBiome edge) {
|
BCLBiome _setEdge(BCLBiome edge) {
|
||||||
this.edge = edge.biomeID;
|
if (edge != null) {
|
||||||
edge.biomeParent = this.biomeID;
|
this.edge = edge.biomeID;
|
||||||
|
edge.biomeParent = this.biomeID;
|
||||||
|
} else {
|
||||||
|
this.edge = null;
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +297,7 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
if (this.edge != null) {
|
if (this.edge != null) {
|
||||||
newEdge.biomeParent = this.edge;
|
newEdge.biomeParent = this.edge;
|
||||||
} else {
|
} else {
|
||||||
this.setEdge(newEdge);
|
this._setEdge(newEdge);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -329,9 +326,9 @@ public class BCLBiome extends BCLBiomeSettings implements BiomeData {
|
||||||
BCLBiome b = entry.getValue();
|
BCLBiome b = entry.getValue();
|
||||||
if (
|
if (
|
||||||
this.biomeID.equals(entry.getValue().biomeParent)
|
this.biomeID.equals(entry.getValue().biomeParent)
|
||||||
&& !entry.getValue().getID().equals(edge)
|
&& !entry.getValue().isEdgeBiome()
|
||||||
) {
|
) {
|
||||||
subbiomes.add(b, b.genChance);
|
subbiomes.add(b, b.settings.genChance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -930,7 +930,6 @@ public class BCLBiomeBuilder {
|
||||||
.setFogDensity(fogDensity)
|
.setFogDensity(fogDensity)
|
||||||
.setGenChance(genChance)
|
.setGenChance(genChance)
|
||||||
.setEdgeSize(edgeSize)
|
.setEdgeSize(edgeSize)
|
||||||
.setEdge(edge)
|
|
||||||
.setVertical(vertical)
|
.setVertical(vertical)
|
||||||
.build();
|
.build();
|
||||||
final T bclBiome = biomeConstructor.apply(ResourceKey.create(Registries.BIOME, biomeID), settings);
|
final T bclBiome = biomeConstructor.apply(ResourceKey.create(Registries.BIOME, biomeID), settings);
|
||||||
|
@ -951,7 +950,7 @@ public class BCLBiomeBuilder {
|
||||||
builder.specialEffects(getEffects().build());
|
builder.specialEffects(getEffects().build());
|
||||||
|
|
||||||
if (edge != null) {
|
if (edge != null) {
|
||||||
bclBiome.setEdge(edge);
|
bclBiome._setEdge(edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
//res.addBiomeTags(tags);
|
//res.addBiomeTags(tags);
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package org.betterx.bclib.api.v2.levelgen.biomes;
|
package org.betterx.bclib.api.v2.levelgen.biomes;
|
||||||
|
|
||||||
import org.betterx.bclib.api.v2.generator.BiomePicker;
|
import org.betterx.bclib.api.v2.generator.BiomePicker;
|
||||||
import org.betterx.bclib.config.Configs;
|
|
||||||
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.world.level.biome.Biome;
|
|
||||||
|
|
||||||
public class BCLBiomeSettings {
|
public class BCLBiomeSettings {
|
||||||
public static Builder createBCL() {
|
public static Builder createBCL() {
|
||||||
|
@ -81,17 +77,6 @@ public class BCLBiomeSettings {
|
||||||
return (R) this;
|
return (R) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set edges:biome for this biome.
|
|
||||||
*
|
|
||||||
* @param edge The {@link Biome}.
|
|
||||||
* @return same {@link Builder}.
|
|
||||||
*/
|
|
||||||
public R setEdge(BCLBiome edge) {
|
|
||||||
storage.edge = edge == null ? null : edge.getID();
|
|
||||||
return (R) this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets fog density for this biome.
|
* Sets fog density for this biome.
|
||||||
*
|
*
|
||||||
|
@ -109,15 +94,13 @@ public class BCLBiomeSettings {
|
||||||
float fogDensity,
|
float fogDensity,
|
||||||
float genChance,
|
float genChance,
|
||||||
int edgeSize,
|
int edgeSize,
|
||||||
boolean vertical,
|
boolean vertical
|
||||||
ResourceLocation edge
|
|
||||||
) {
|
) {
|
||||||
this.terrainHeight = terrainHeight;
|
this.terrainHeight = terrainHeight;
|
||||||
this.fogDensity = fogDensity;
|
this.fogDensity = fogDensity;
|
||||||
this.genChance = genChance;
|
this.genChance = genChance;
|
||||||
this.edgeSize = edgeSize;
|
this.edgeSize = edgeSize;
|
||||||
this.vertical = vertical;
|
this.vertical = vertical;
|
||||||
this.edge = edge;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BCLBiomeSettings() {
|
protected BCLBiomeSettings() {
|
||||||
|
@ -126,7 +109,6 @@ public class BCLBiomeSettings {
|
||||||
this.genChance = 1.0F;
|
this.genChance = 1.0F;
|
||||||
this.edgeSize = 0;
|
this.edgeSize = 0;
|
||||||
this.vertical = false;
|
this.vertical = false;
|
||||||
this.edge = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float terrainHeight;
|
float terrainHeight;
|
||||||
|
@ -134,7 +116,6 @@ public class BCLBiomeSettings {
|
||||||
float genChance;
|
float genChance;
|
||||||
int edgeSize;
|
int edgeSize;
|
||||||
boolean vertical;
|
boolean vertical;
|
||||||
ResourceLocation edge;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,39 +162,4 @@ public class BCLBiomeSettings {
|
||||||
public int getEdgeSize() {
|
public int getEdgeSize() {
|
||||||
return edgeSize;
|
return edgeSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Getter for edge-biome.
|
|
||||||
*
|
|
||||||
* @return The assigned edge biome.
|
|
||||||
*/
|
|
||||||
public BCLBiome getEdge() {
|
|
||||||
return BiomeAPI.getBiome(edge);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load values from Config and apply to the passed Biome. The Default values for the loaded settings
|
|
||||||
* are derifed from the values store in this object
|
|
||||||
*
|
|
||||||
* @param biome {@link BCLBiome} to assign values to
|
|
||||||
*/
|
|
||||||
public void applyWithDefaults(BCLBiome biome) {
|
|
||||||
final String group = biome.configGroup();
|
|
||||||
biome.genChance = Configs.BIOMES_CONFIG.getFloat(group, "generation_chance", this.genChance);
|
|
||||||
|
|
||||||
if (edge != null) {
|
|
||||||
biome.edgeSize = Configs.BIOMES_CONFIG.getInt(group, "edge_size", this.edgeSize);
|
|
||||||
if (edgeSize > 0) {
|
|
||||||
biome.setEdgeID(edge);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(this instanceof VanillaBiomeSettings)) {
|
|
||||||
biome.fogDensity = Configs.BIOMES_CONFIG.getFloat(group, "fog_density", this.fogDensity);
|
|
||||||
biome.vertical = Configs.BIOMES_CONFIG.getBoolean(group, "vertical", this.vertical);
|
|
||||||
biome.terrainHeight = Configs.BIOMES_CONFIG.getFloat(group, "terrain_height", this.terrainHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
Configs.BIOMES_CONFIG.saveChanges();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ public class BiomeAPI {
|
||||||
public static final BiomeType END_CENTER = new BiomeType("END_CENTER", END);
|
public static final BiomeType END_CENTER = new BiomeType("END_CENTER", END);
|
||||||
public static final BiomeType END_BARRENS = new BiomeType("END_BARRENS", END);
|
public static final BiomeType END_BARRENS = new BiomeType("END_BARRENS", END);
|
||||||
public static final BiomeType BCL_END_LAND = new BiomeType("BCL_END_LAND", END_LAND, (biome, ignored) -> {
|
public static final BiomeType BCL_END_LAND = new BiomeType("BCL_END_LAND", END_LAND, (biome, ignored) -> {
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
|
|
||||||
if (biome.isEdgeBiome()) {
|
if (biome.isEdgeBiome()) {
|
||||||
|
@ -166,14 +166,14 @@ public class BiomeAPI {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
public static final BiomeType BCL_END_VOID = new BiomeType("BCL_END_VOID", END_VOID, (biome, ignored) -> {
|
public static final BiomeType BCL_END_VOID = new BiomeType("BCL_END_VOID", END_VOID, (biome, ignored) -> {
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
if (!biome.isEdgeBiome()) {
|
if (!biome.isEdgeBiome()) {
|
||||||
TheEndBiomes.addSmallIslandsBiome(key, weight);
|
TheEndBiomes.addSmallIslandsBiome(key, weight);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
public static final BiomeType BCL_END_CENTER = new BiomeType("BCL_END_CENTER", END_CENTER, (biome, ignored) -> {
|
public static final BiomeType BCL_END_CENTER = new BiomeType("BCL_END_CENTER", END_CENTER, (biome, ignored) -> {
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
if (!biome.isEdgeBiome()) {
|
if (!biome.isEdgeBiome()) {
|
||||||
TheEndBiomes.addMainIslandBiome(key, weight);
|
TheEndBiomes.addMainIslandBiome(key, weight);
|
||||||
|
@ -184,7 +184,7 @@ public class BiomeAPI {
|
||||||
"BCL_END_BARRENS",
|
"BCL_END_BARRENS",
|
||||||
END_BARRENS,
|
END_BARRENS,
|
||||||
(biome, highlandBiome) -> {
|
(biome, highlandBiome) -> {
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
if (!biome.isEdgeBiome()) {
|
if (!biome.isEdgeBiome()) {
|
||||||
ResourceKey<Biome> parentKey = highlandBiome.getBiomeKey();
|
ResourceKey<Biome> parentKey = highlandBiome.getBiomeKey();
|
||||||
|
@ -339,7 +339,7 @@ public class BiomeAPI {
|
||||||
static BCLBiome registerEndLandBiome(BootstapContext<Biome> bootstrapContext, BCLBiome biome) {
|
static BCLBiome registerEndLandBiome(BootstapContext<Biome> bootstrapContext, BCLBiome biome) {
|
||||||
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_LAND);
|
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_LAND);
|
||||||
|
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
|
|
||||||
if (biome.isEdgeBiome()) {
|
if (biome.isEdgeBiome()) {
|
||||||
|
@ -363,7 +363,7 @@ public class BiomeAPI {
|
||||||
static BCLBiome registerEndVoidBiome(BootstapContext<Biome> bootstrapContext, BCLBiome biome) {
|
static BCLBiome registerEndVoidBiome(BootstapContext<Biome> bootstrapContext, BCLBiome biome) {
|
||||||
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_VOID);
|
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_VOID);
|
||||||
|
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
if (!biome.isEdgeBiome()) {
|
if (!biome.isEdgeBiome()) {
|
||||||
TheEndBiomes.addSmallIslandsBiome(key, weight);
|
TheEndBiomes.addSmallIslandsBiome(key, weight);
|
||||||
|
@ -382,7 +382,7 @@ public class BiomeAPI {
|
||||||
static BCLBiome registerEndCenterBiome(BootstapContext<Biome> bootstrapContext, BCLBiome biome) {
|
static BCLBiome registerEndCenterBiome(BootstapContext<Biome> bootstrapContext, BCLBiome biome) {
|
||||||
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_CENTER);
|
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_CENTER);
|
||||||
|
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
if (!biome.isEdgeBiome()) {
|
if (!biome.isEdgeBiome()) {
|
||||||
TheEndBiomes.addMainIslandBiome(key, weight);
|
TheEndBiomes.addMainIslandBiome(key, weight);
|
||||||
|
@ -405,7 +405,7 @@ public class BiomeAPI {
|
||||||
) {
|
) {
|
||||||
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_BARRENS);
|
registerBuiltinBiomeAndOverrideIntendedDimension(bootstrapContext, biome, BiomeType.BCL_END_BARRENS);
|
||||||
|
|
||||||
float weight = biome.getGenChance();
|
float weight = biome.settings.getGenChance();
|
||||||
ResourceKey<Biome> key = biome.getBiomeKey();
|
ResourceKey<Biome> key = biome.getBiomeKey();
|
||||||
if (!biome.isEdgeBiome()) {
|
if (!biome.isEdgeBiome()) {
|
||||||
ResourceKey<Biome> parentKey = highlandBiome.getBiomeKey();
|
ResourceKey<Biome> parentKey = highlandBiome.getBiomeKey();
|
||||||
|
|
|
@ -223,9 +223,11 @@ public class InternalBiomeAPI {
|
||||||
) {
|
) {
|
||||||
VanillaBiomeSettings.Builder settings = VanillaBiomeSettings.createVanilla();
|
VanillaBiomeSettings.Builder settings = VanillaBiomeSettings.createVanilla();
|
||||||
if (genChance >= 0) settings.setGenChance(genChance);
|
if (genChance >= 0) settings.setGenChance(genChance);
|
||||||
settings.setEdge(edgeBiome);
|
|
||||||
settings.setEdgeSize(edgeBiomeSize);
|
settings.setEdgeSize(edgeBiomeSize);
|
||||||
return wrapBiome(biomeKey, settings.build(), type);
|
|
||||||
|
final BCLBiome b = wrapBiome(biomeKey, settings.build(), type);
|
||||||
|
b._setEdge(edgeBiome);
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -124,9 +124,9 @@ public class CustomFogRenderer {
|
||||||
Biome biome = level.getBiome(MUT_POS.set(x, y, z)).value();
|
Biome biome = level.getBiome(MUT_POS.set(x, y, z)).value();
|
||||||
BCLBiome renderBiome = BiomeAPI.getRenderBiome(biome);
|
BCLBiome renderBiome = BiomeAPI.getRenderBiome(biome);
|
||||||
if (renderBiome == null) {
|
if (renderBiome == null) {
|
||||||
return BCLBiomeRegistry.EMPTY_BIOME.getFogDensity();
|
return BCLBiomeRegistry.EMPTY_BIOME.settings.getFogDensity();
|
||||||
}
|
}
|
||||||
return renderBiome.getFogDensity();
|
return renderBiome.settings.getFogDensity();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static float getFogDensity(Level level, double x, double y, double z) {
|
private static float getFogDensity(Level level, double x, double y, double z) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue