Record Class BiomeDefinition

java.lang.Object
java.lang.Record
fr.fidorial.world.biome.BiomeDefinition
Record Components:
key - the key of the biome, typed against the minecraft:worldgen/biome registry
hasPrecipitation - whether rain or snow may fall
temperature - biome temperature, driving snow, freezing water and the default colors
temperatureModifier - how the client reinterprets temperature
downfall - humidity, within [0, 1], driving the default foliage colors
effects - the client-side tinting
attributes - the environment attributes this biome sets, possibly empty

public record BiomeDefinition(TypedKey<BiomeDefinition> key, boolean hasPrecipitation, float temperature, TemperatureModifier temperatureModifier, float downfall, BiomeEffects effects, EnvironmentAttributes attributes) extends Record
A complete biome definition, ready to be sent to clients.
Since:
0.1.0
  • Constructor Details

  • Method Details

    • builder

      @Contract(value="_ -> new", pure=true) public static BiomeBuilder builder(TypedKey<BiomeDefinition> key)
      Returns a new builder for the biome identified by key.
      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 of definition.
      Parameters:
      definition - the definition to copy
      Returns:
      a new builder pre-filled with the values of definition
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • key

      public TypedKey<BiomeDefinition> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • hasPrecipitation

      public boolean hasPrecipitation()
      Returns the value of the hasPrecipitation record component.
      Returns:
      the value of the hasPrecipitation record component
    • temperature

      public float temperature()
      Returns the value of the temperature record component.
      Returns:
      the value of the temperature record component
    • temperatureModifier

      public TemperatureModifier temperatureModifier()
      Returns the value of the temperatureModifier record component.
      Returns:
      the value of the temperatureModifier record component
    • downfall

      public float downfall()
      Returns the value of the downfall record component.
      Returns:
      the value of the downfall record component
    • effects

      public BiomeEffects effects()
      Returns the value of the effects record component.
      Returns:
      the value of the effects record component
    • attributes

      public EnvironmentAttributes attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component