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 floatThe field for thedownfallrecord component.static final com.mojang.serialization.MapCodec<GrassColorSource> private final floatThe field for thetemperaturerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionGrassColorSource(float temperature, float downfall) Creates an instance of aGrassColorSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcalculate(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner) floatdownfall()Returns the value of thedownfallrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.com.mojang.serialization.MapCodec<GrassColorSource> type()
-
Field Details
-
temperature
private final float temperatureThe field for thetemperaturerecord component. -
downfall
private final float downfallThe field for thedownfallrecord component. -
MAP_CODEC
-
-
Constructor Details
-
GrassColorSource
public GrassColorSource() -
GrassColorSource
public GrassColorSource(float temperature, float downfall) Creates an instance of aGrassColorSourcerecord class.- Parameters:
temperature- the value for thetemperaturerecord componentdownfall- the value for thedownfallrecord component
-
-
Method Details
-
calculate
public int calculate(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner) - Specified by:
calculatein interfaceItemTintSource
-
type
- Specified by:
typein interfaceItemTintSource
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
temperature
public float temperature()Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
downfall
public float downfall()Returns the value of thedownfallrecord component.- Returns:
- the value of the
downfallrecord component
-