Package net.minecraft.client.color.item
Record Class Potion
java.lang.Object
java.lang.Record
net.minecraft.client.color.item.Potion
- All Implemented Interfaces:
ItemTintSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thedefaultColorrecord component.static final com.mojang.serialization.MapCodec<Potion> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcalculate(ItemStack p_387621_, ClientLevel p_390426_, LivingEntity p_390389_) 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<Potion> type()
-
Field Details
-
defaultColor
private final int defaultColorThe field for thedefaultColorrecord component. -
MAP_CODEC
-
-
Constructor Details
-
Potion
public Potion() -
Potion
public Potion(int defaultColor) Creates an instance of aPotionrecord class.- Parameters:
defaultColor- the value for thedefaultColorrecord component
-
-
Method Details
-
calculate
public int calculate(ItemStack p_387621_, @Nullable ClientLevel p_390426_, @Nullable LivingEntity p_390389_) - Specified by:
calculatein interfaceItemTintSource
-
type
- Specified by:
typein 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 '=='. -
defaultColor
public int defaultColor()Returns the value of thedefaultColorrecord component.- Returns:
- the value of the
defaultColorrecord component
-