Package net.minecraft.client.color.item
Record Class GrassColorSource
java.lang.Object
java.lang.Record
net.minecraft.client.color.item.GrassColorSource
- All Implemented Interfaces:
ItemTintSource
public record GrassColorSource(float temperature, float downfall)
extends Record
implements ItemTintSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float
The field for thedownfall
record component.static final com.mojang.serialization.MapCodec
<GrassColorSource> private final float
The field for thetemperature
record component. -
Constructor Summary
ConstructorsConstructorDescriptionGrassColorSource
(float temperature, float downfall) Creates an instance of aGrassColorSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
calculate
(ItemStack p_388684_, ClientLevel p_390380_, LivingEntity p_390527_) float
downfall()
Returns the value of thedownfall
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.float
Returns the value of thetemperature
record component.final String
toString()
Returns a string representation of this record class.com.mojang.serialization.MapCodec
<GrassColorSource> type()
-
Field Details
-
temperature
private final float temperatureThe field for thetemperature
record component. -
downfall
private final float downfallThe field for thedownfall
record component. -
MAP_CODEC
-
-
Constructor Details
-
GrassColorSource
public GrassColorSource() -
GrassColorSource
public GrassColorSource(float temperature, float downfall) Creates an instance of aGrassColorSource
record class.- Parameters:
temperature
- the value for thetemperature
record componentdownfall
- the value for thedownfall
record component
-
-
Method Details
-
calculate
public int calculate(ItemStack p_388684_, @Nullable ClientLevel p_390380_, @Nullable LivingEntity p_390527_) - Specified by:
calculate
in interfaceItemTintSource
-
type
- Specified by:
type
in interfaceItemTintSource
-
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. -
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. -
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. All components in this record class are compared with '=='. -
temperature
public float temperature()Returns the value of thetemperature
record component.- Returns:
- the value of the
temperature
record component
-
downfall
public float downfall()Returns the value of thedownfall
record component.- Returns:
- the value of the
downfall
record component
-