Interface EnvironmentAttribute<V>

Type Parameters:
V - the type of the environment attribute
All Superinterfaces:
Keyed, Wrapper

@NullMarked @AsOf("1.1.0") public interface EnvironmentAttribute<V> extends Wrapper, Keyed
Environment attributes control various visual and gameplay features depending on the dimension, biome, time, and weather and can be applied to Biomes and Dimensions.
Since:
1.1.0
See Also:
  • Field Details

  • Method Details

    • key

      @AsOf("3.0.0") ResourceKey key()
      Gets the key of the environment attribute.
      Specified by:
      key in interface Keyed
      Returns:
      the key of the environment attribute
      Since:
      3.0.0
    • value

      @AsOf("3.0.0") @MonotonicNonNull V value()
      Gets the value of the environment attribute.
      Returns:
      the value of the environment attribute, if present
      Since:
      3.0.0
    • value

      @AsOf("3.0.0") void value(V value)
      Sets the value of the environment attribute.
      Parameters:
      value - the value to set
      Since:
      3.0.0
    • defaultValue

      @AsOf("3.0.0") V defaultValue()
      Gets the default value of the environment attribute.
      Returns:
      the default value of the environment attribute
      Throws:
      UnsupportedOperationException - if the default value isn't decodable yet :(
      Since:
      3.0.0
    • minecraftValue

      @AsOf("3.0.0") <U> U minecraftValue()
      Gets the underlying Minecraft value of the environment attribute.
      Type Parameters:
      U - the type of the underlying Minecraft value
      Returns:
      the underlying Minecraft value of the environment attribute
      Since:
      3.0.0
    • minecraftDefaultValue

      @AsOf("3.0.0") <U> U minecraftDefaultValue()
      Gets the default Minecraft value of the environment attribute.
      Type Parameters:
      U - the type of the default Minecraft value
      Returns:
      the default Minecraft value of the environment attribute
      Since:
      3.0.0
    • syncable

      @AsOf("3.0.0") boolean syncable()
      If the client handles processing of this attribute.
      Returns:
      true if the client handles processing of this attribute, false otherwise
      Since:
      3.0.0
    • spatiallyInterpolated

      @AsOf("3.0.0") boolean spatiallyInterpolated()
      If the attribute is spatially interpolated.
      Returns:
      true if the attribute is spatially interpolated, false otherwise
      Since:
      3.0.0
    • positional

      @AsOf("3.0.0") boolean positional()
      If the attribute is positional.
      Returns:
      true if the attribute is positional, false otherwise
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static <V,U> EnvironmentAttribute<V> of(ResourceKey key, @Nullable EnvironmentAttribute.Converter<V,U> converter, @Nullable V defaultValue)
      Gets an EnvironmentAttribute instance for the given key and default value.
      Type Parameters:
      V - the type of the environment attribute
      U - the underlying type of the environment attribute
      Parameters:
      key - the key of the environment attribute
      converter - the converter for the environment attribute
      defaultValue - the default value of the environment attribute
      Returns:
      an EnvironmentAttribute instance for the given key and default value
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static <V,U> EnvironmentAttribute<V> of(ResourceKey key, @Nullable EnvironmentAttribute.Converter<V,U> converter)
      Gets an EnvironmentAttribute instance for the given key.
      Type Parameters:
      V - the type of the environment attribute
      U - the underlying type of the environment attribute
      Parameters:
      key - the key of the environment attribute
      converter - the converter for the environment attribute
      Returns:
      an EnvironmentAttribute instance for the given key
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static <V> EnvironmentAttribute<V> of(ResourceKey key)
      Gets an EnvironmentAttribute instance for the given key.
      Type Parameters:
      V - the type of the environment attribute
      Parameters:
      key - the key of the environment attribute
      Returns:
      an EnvironmentAttribute instance for the given key
      Since:
      3.0.0
    • ofSupplier

      @AsOf("1.1.0") static <V,U> EnvironmentAttributeSupplier<V> ofSupplier(ResourceKey key, @Nullable EnvironmentAttribute.Converter<V,U> converter)
      Gets an EnvironmentAttributeSupplier instance for the given key and default value.
      Type Parameters:
      V - the type of the environment attribute
      U - the underlying type of the environment attribute
      Parameters:
      key - the key of the environment attribute
      converter - the converter for the environment attribute
      Returns:
      an EnvironmentAttributeSupplier instance for the given key and default value
      Since:
      1.1.0
    • ofSupplier

      @AsOf("1.1.0") static <V> EnvironmentAttributeSupplier<V> ofSupplier(ResourceKey key)
      Gets an EnvironmentAttributeSupplier instance for the given key.
      Type Parameters:
      V - the type of the environment attribute
      Parameters:
      key - the key of the environment attribute
      Returns:
      an EnvironmentAttributeSupplier instance for the given key
      Since:
      1.1.0
    • ofFriendlyColorSupplier

      @AsOf("3.0.0") static FriendlyColorSupplier ofFriendlyColorSupplier(ResourceKey key)
      Gets a FriendlyColorSupplier instance for the given key.
      Parameters:
      key - the key of the environment attribute
      Returns:
      a FriendlyColorSupplier instance for the given key
      Since:
      3.0.0