Class BiomeBuilder

java.lang.Object
fr.fidorial.world.biome.BiomeBuilder

public final class BiomeBuilder extends Object
Fluent builder for BiomeDefinition.
Since:
0.1.0
  • Method Details

    • key

      @Contract("_ -> this") public BiomeBuilder key(Key key)
      Parameters:
      key - the namespaced identifier of the biome
      Returns:
      this builder
    • hasPrecipitation

      @Contract("_ -> this") public BiomeBuilder hasPrecipitation(boolean hasPrecipitation)
      Parameters:
      hasPrecipitation - whether rain or snow may fall in the biome
      Returns:
      this builder
    • temperature

      @Contract("_ -> this") public BiomeBuilder temperature(float temperature)
      Sets the biome temperature.

      Below 0.15 water freezes and precipitation falls as snow; above 1.0 the client stops rendering rain entirely.

      Parameters:
      temperature - the biome temperature
      Returns:
      this builder
    • temperatureModifier

      @Contract("_ -> this") public BiomeBuilder temperatureModifier(TemperatureModifier modifier)
      Parameters:
      modifier - how the client reinterprets the temperature
      Returns:
      this builder
    • downfall

      @Contract("_ -> this") public BiomeBuilder downfall(float downfall)
      Parameters:
      downfall - humidity within [0, 1]
      Returns:
      this builder
    • effects

      @Contract("_ -> this") public BiomeBuilder effects(BiomeEffects effects)
      Parameters:
      effects - the client-side effects
      Returns:
      this builder
    • effects

      @Contract("_ -> this") public BiomeBuilder effects(Consumer<BiomeEffects.Builder> configurer)
      Configures the effects in place, starting from the ones currently set.
      Parameters:
      configurer - callback receiving a pre-filled effects builder
      Returns:
      this builder
    • attributes

      @Contract("_ -> this") public BiomeBuilder attributes(EnvironmentAttributes attributes)
      Replaces the whole environment attribute map.
      Parameters:
      attributes - the attributes this biome sets
      Returns:
      this builder
    • attributes

      @Contract("_ -> this") public BiomeBuilder attributes(Consumer<EnvironmentAttributes.Builder> configurer)
      Configures the environment attributes in place, starting from what is already set.
      Parameters:
      configurer - callback receiving the attribute builder
      Returns:
      this builder
    • skyColor

      @Contract("_ -> this") public BiomeBuilder skyColor(@Nullable Integer color)
      Shorthand for minecraft:visual/sky_color.
      Parameters:
      color - packed RGB color of the sky
      Returns:
      this builder
    • fogColor

      @Contract("_ -> this") public BiomeBuilder fogColor(@Nullable Integer color)
      Shorthand for minecraft:visual/fog_color.
      Parameters:
      color - packed RGB color of the distance fog
      Returns:
      this builder
    • waterFogColor

      @Contract("_ -> this") public BiomeBuilder waterFogColor(@Nullable Integer color)
      Shorthand for minecraft:visual/water_fog_color.
      Parameters:
      color - packed RGB color of the underwater fog
      Returns:
      this builder
    • addAmbientParticle

      @Contract("_ -> this") public BiomeBuilder addAmbientParticle(AmbientParticle particle)
      Shorthand for minecraft:visual/ambient_particles.
      Parameters:
      particle - the particle to add
      Returns:
      this builder
    • ambientSounds

      @Contract("_ -> this") public BiomeBuilder ambientSounds(@Nullable AmbientSounds sounds)
      Shorthand for minecraft:audio/ambient_sounds.
      Parameters:
      sounds - the ambient sounds, or null to leave unset
      Returns:
      this builder
    • backgroundMusic

      @Contract("_ -> this") public BiomeBuilder backgroundMusic(@Nullable BackgroundMusic music)
      Shorthand for minecraft:audio/background_music.
      Parameters:
      music - the background music, or null to leave unset
      Returns:
      this builder
    • vanillaSkyColor

      @Contract("-> this") public BiomeBuilder vanillaSkyColor()
      Sets the sky color to the value vanilla would derive from the current temperature.

      Call this after temperature(float).

      Returns:
      this builder
    • build

      @Contract(value="-> new", pure=true) public BiomeDefinition build()
      Returns the immutable definition described by this builder.
      Returns:
      the immutable definition described by this builder