Record Class BiomeDefinition
java.lang.Object
java.lang.Record
fr.fidorial.world.biome.BiomeDefinition
- Record Components:
key- the namespaced identifier of the biomehasPrecipitation- whether rain or snow may falltemperature- biome temperature, driving snow, freezing water and the default colorstemperatureModifier- how the client reinterpretstemperaturedownfall- humidity, within[0, 1], driving the default foliage colorseffects- the client-side tintingattributes- the environment attributes this biome sets, possibly empty
public record BiomeDefinition(Key key, boolean hasPrecipitation, float temperature, TemperatureModifier temperatureModifier, float downfall, BiomeEffects effects, EnvironmentAttributes attributes)
extends Record
implements Biome
A complete biome definition, ready to be sent to clients.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionBiomeDefinition(Key key, boolean hasPrecipitation, float temperature, TemperatureModifier temperatureModifier, float downfall, BiomeEffects effects, EnvironmentAttributes attributes) Creates an instance of aBiomeDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.static BiomeBuilderbuilder(BiomeDefinition definition) Returns a new builder pre-filled with the values ofdefinition.static BiomeBuilderReturns a new builder for the biome identified bykey.floatdownfall()Returns the value of thedownfallrecord component.effects()Returns the value of theeffectsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasPrecipitationrecord component.key()Returns the value of thekeyrecord component.floatReturns the value of thetemperaturerecord component.Returns the value of thetemperatureModifierrecord component.final StringtoString()Returns a string representation of this record class.typedKey()Returns this biome's key, typed against theminecraft:worldgen/biomeregistry.
-
Constructor Details
-
BiomeDefinition
public BiomeDefinition(Key key, boolean hasPrecipitation, float temperature, TemperatureModifier temperatureModifier, float downfall, BiomeEffects effects, EnvironmentAttributes attributes) Creates an instance of aBiomeDefinitionrecord class.- Parameters:
key- the value for thekeyrecord componenthasPrecipitation- the value for thehasPrecipitationrecord componenttemperature- the value for thetemperaturerecord componenttemperatureModifier- the value for thetemperatureModifierrecord componentdownfall- the value for thedownfallrecord componenteffects- the value for theeffectsrecord componentattributes- the value for theattributesrecord component
-
-
Method Details
-
builder
Returns a new builder for the biome identified bykey.- Parameters:
key- the namespaced identifier of the biome- Returns:
- a new builder for the biome identified by
key
-
builder
@Contract(value="_ -> new", pure=true) public static BiomeBuilder builder(BiomeDefinition definition) Returns a new builder pre-filled with the values ofdefinition.- Parameters:
definition- the definition to copy- Returns:
- a new builder pre-filled with the values of
definition
-
typedKey
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
key
-
hasPrecipitation
public boolean hasPrecipitation()Returns the value of thehasPrecipitationrecord component.- Returns:
- the value of the
hasPrecipitationrecord component
-
temperature
public float temperature()Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
temperatureModifier
Returns the value of thetemperatureModifierrecord component.- Returns:
- the value of the
temperatureModifierrecord component
-
downfall
-
effects
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-