Remove obsolete scale and depth fields for biomes

This commit is contained in:
AmGone_ 2024-03-29 21:21:25 +01:00 committed by iam
parent 452943df23
commit b0e38f14b9
2 changed files with 2 additions and 35 deletions

View File

@ -24,9 +24,7 @@ sealed public interface Biome extends ProtocolObject permits BiomeImpl {
@Override @Override
@NotNull NamespaceID namespace(); @NotNull NamespaceID namespace();
float depth();
float temperature(); float temperature();
float scale();
float downfall(); float downfall();
@NotNull BiomeEffects effects(); @NotNull BiomeEffects effects();
@NotNull Precipitation precipitation(); @NotNull Precipitation precipitation();
@ -61,12 +59,9 @@ sealed public interface Biome extends ProtocolObject permits BiomeImpl {
Check.notNull(effects(), "The biome effects cannot be null"); Check.notNull(effects(), "The biome effects cannot be null");
return NBT.Compound(element -> { return NBT.Compound(element -> {
element.setFloat("depth", depth());
element.setFloat("temperature", temperature()); element.setFloat("temperature", temperature());
element.setFloat("scale", scale());
element.setFloat("downfall", downfall()); element.setFloat("downfall", downfall());
element.setByte("has_precipitation", (byte) (precipitation() == Precipitation.NONE ? 0 : 1)); element.setByte("has_precipitation", (byte) (precipitation() == Precipitation.NONE ? 0 : 1));
element.setString("precipitation", precipitation().name().toLowerCase(Locale.ROOT));
if (temperatureModifier() != TemperatureModifier.NONE) if (temperatureModifier() != TemperatureModifier.NONE)
element.setString("temperature_modifier", temperatureModifier().name().toLowerCase(Locale.ROOT)); element.setString("temperature_modifier", temperatureModifier().name().toLowerCase(Locale.ROOT));
element.set("effects", effects().toNbt()); element.set("effects", effects().toNbt());
@ -86,9 +81,7 @@ sealed public interface Biome extends ProtocolObject permits BiomeImpl {
.build(); .build();
private NamespaceID name; private NamespaceID name;
private float depth = 0.2f;
private float temperature = 0.25f; private float temperature = 0.25f;
private float scale = 0.2f;
private float downfall = 0.8f; private float downfall = 0.8f;
private BiomeEffects effects = DEFAULT_EFFECTS; private BiomeEffects effects = DEFAULT_EFFECTS;
private Precipitation precipitation = Precipitation.RAIN; private Precipitation precipitation = Precipitation.RAIN;
@ -100,24 +93,12 @@ sealed public interface Biome extends ProtocolObject permits BiomeImpl {
return this; return this;
} }
@Contract(value = "_ -> this", pure = true)
public @NotNull Builder depth(float depth) {
this.depth = depth;
return this;
}
@Contract(value = "_ -> this", pure = true) @Contract(value = "_ -> this", pure = true)
public @NotNull Builder temperature(float temperature) { public @NotNull Builder temperature(float temperature) {
this.temperature = temperature; this.temperature = temperature;
return this; return this;
} }
@Contract(value = "_ -> this", pure = true)
public @NotNull Builder scale(float scale) {
this.scale = scale;
return this;
}
@Contract(value = "_ -> this", pure = true) @Contract(value = "_ -> this", pure = true)
public @NotNull Builder downfall(float downfall) { public @NotNull Builder downfall(float downfall) {
this.downfall = downfall; this.downfall = downfall;
@ -144,7 +125,7 @@ sealed public interface Biome extends ProtocolObject permits BiomeImpl {
@Contract(pure = true) @Contract(pure = true)
public @NotNull Biome build() { public @NotNull Biome build() {
return new BiomeImpl(name, depth, temperature, scale, downfall, effects, precipitation, temperatureModifier); return new BiomeImpl(name, temperature, downfall, effects, precipitation, temperatureModifier);
} }
} }
} }

View File

@ -30,9 +30,7 @@ final class BiomeImpl implements ProtocolObject, Biome {
private Registry.BiomeEntry entry; private Registry.BiomeEntry entry;
@NotNull @NotNull
private final NamespaceID name; private final NamespaceID name;
private final float depth;
private final float temperature; private final float temperature;
private final float scale;
private final float downfall; private final float downfall;
@NotNull @NotNull
private final BiomeEffects effects; private final BiomeEffects effects;
@ -41,11 +39,9 @@ final class BiomeImpl implements ProtocolObject, Biome {
@NotNull @NotNull
private final TemperatureModifier temperatureModifier; private final TemperatureModifier temperatureModifier;
BiomeImpl(NamespaceID name, float depth, float temperature, float scale, float downfall, BiomeEffects effects, Precipitation precipitation, TemperatureModifier temperatureModifier) { BiomeImpl(NamespaceID name, float temperature, float downfall, BiomeEffects effects, Precipitation precipitation, TemperatureModifier temperatureModifier) {
this.name = name; this.name = name;
this.depth = depth;
this.temperature = temperature; this.temperature = temperature;
this.scale = scale;
this.downfall = downfall; this.downfall = downfall;
this.effects = effects; this.effects = effects;
this.precipitation = precipitation; this.precipitation = precipitation;
@ -55,8 +51,6 @@ final class BiomeImpl implements ProtocolObject, Biome {
BiomeImpl(Registry.BiomeEntry entry) { BiomeImpl(Registry.BiomeEntry entry) {
this.entry = entry; this.entry = entry;
this.name = entry.namespace(); this.name = entry.namespace();
this.depth = 0.2f;
this.scale = 0.2f;
this.temperature = entry.temperature(); this.temperature = entry.temperature();
BiomeEffects.Builder effectsBuilder = getBuilder(entry); BiomeEffects.Builder effectsBuilder = getBuilder(entry);
@ -95,18 +89,10 @@ final class BiomeImpl implements ProtocolObject, Biome {
return this.name; return this.name;
} }
public float depth() {
return this.depth;
}
public float temperature() { public float temperature() {
return this.temperature; return this.temperature;
} }
public float scale() {
return this.scale;
}
public float downfall() { public float downfall() {
return this.downfall; return this.downfall;
} }