Package net.minecraft.client.color.item
Record Class CustomModelDataSource
java.lang.Object
java.lang.Record
net.minecraft.client.color.item.CustomModelDataSource
- All Implemented Interfaces:
ItemTintSource
public record CustomModelDataSource(int index, int defaultColor)
extends Record
implements ItemTintSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The field for thedefaultColor
record component.private final int
The field for theindex
record component.static final com.mojang.serialization.MapCodec
<CustomModelDataSource> -
Constructor Summary
ConstructorsConstructorDescriptionCustomModelDataSource
(int index, int defaultColor) Creates an instance of aCustomModelDataSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
calculate
(ItemStack p_387541_, ClientLevel p_390516_, LivingEntity p_390366_) int
Returns the value of thedefaultColor
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.int
index()
Returns the value of theindex
record component.final String
toString()
Returns a string representation of this record class.com.mojang.serialization.MapCodec
<CustomModelDataSource> type()
-
Field Details
-
index
private final int indexThe field for theindex
record component. -
defaultColor
private final int defaultColorThe field for thedefaultColor
record component. -
MAP_CODEC
-
-
Constructor Details
-
CustomModelDataSource
public CustomModelDataSource(int index, int defaultColor) Creates an instance of aCustomModelDataSource
record class.- Parameters:
index
- the value for theindex
record componentdefaultColor
- the value for thedefaultColor
record component
-
-
Method Details
-
calculate
public int calculate(ItemStack p_387541_, @Nullable ClientLevel p_390516_, @Nullable LivingEntity p_390366_) - 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 '=='. -
index
public int index()Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
defaultColor
public int defaultColor()Returns the value of thedefaultColor
record component.- Returns:
- the value of the
defaultColor
record component
-