Record Class Dye
java.lang.Object
java.lang.Record
net.minecraft.client.color.item.Dye
- All Implemented Interfaces:
ItemTintSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thedefaultColorrecord component.static final com.mojang.serialization.MapCodec<Dye> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcalculate(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity owner) intReturns the value of thedefaultColorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.com.mojang.serialization.MapCodec<Dye> type()
-
Field Details
-
defaultColor
private final int defaultColorThe field for thedefaultColorrecord component. -
MAP_CODEC
-
-
Constructor Details
-
Dye
public Dye(int defaultColor) Creates an instance of aDyerecord class.- Parameters:
defaultColor- the value for thedefaultColorrecord 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. -
defaultColor
public int defaultColor()Returns the value of thedefaultColorrecord component.- Returns:
- the value of the
defaultColorrecord component
-