Interface EnvironmentAttribute<V>
- Type Parameters:
V- the type of the environment attribute
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceConverts an API value to a Minecraft value.Nested classes/interfaces inherited from interface Wrapper
Wrapper.Context<C> -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGets the default value of the environment attribute.key()Gets the key of the environment attribute.<U> UGets the default Minecraft value of the environment attribute.<U> UGets the underlying Minecraft value of the environment attribute.static <V> EnvironmentAttribute<V> of(ResourceKey key) Gets an EnvironmentAttribute instance for the given key.static <V,U> EnvironmentAttribute <V> of(ResourceKey key, @Nullable EnvironmentAttribute.Converter<V, U> converter) Gets an EnvironmentAttribute instance for the given key.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.static FriendlyColorSupplierGets a FriendlyColorSupplier instance for the given key.static <V> EnvironmentAttributeSupplier<V> ofSupplier(ResourceKey key) Gets an EnvironmentAttributeSupplier instance for the given key.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.booleanIf the attribute is positional.booleanIf the attribute is spatially interpolated.booleansyncable()If the client handles processing of this attribute.@MonotonicNonNull Vvalue()Gets the value of the environment attribute.voidSets the value of the environment attribute.Methods inherited from interface Wrapper
asHandle, toMinecraft
-
Field Details
-
WIRE
-
-
Method Details
-
key
Gets the key of the environment attribute. -
value
-
value
-
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
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
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
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
If the attribute is spatially interpolated.- Returns:
- true if the attribute is spatially interpolated, false otherwise
- Since:
- 3.0.0
-
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 attributeU- the underlying type of the environment attribute- Parameters:
key- the key of the environment attributeconverter- the converter for the environment attributedefaultValue- 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 attributeU- the underlying type of the environment attribute- Parameters:
key- the key of the environment attributeconverter- the converter for the environment attribute- Returns:
- an EnvironmentAttribute instance for the given key
- Since:
- 3.0.0
-
of
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 attributeU- the underlying type of the environment attribute- Parameters:
key- the key of the environment attributeconverter- the converter for the environment attribute- Returns:
- an EnvironmentAttributeSupplier instance for the given key and default value
- Since:
- 1.1.0
-
ofSupplier
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
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
-