Record Class Repairable
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.Repairable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Repairable> The field for theitems
record component.static final StreamCodec
<RegistryFriendlyByteBuf, Repairable> -
Constructor Summary
ConstructorsConstructorDescriptionRepairable
(HolderSet<Item> items) Creates an instance of aRepairable
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isValidRepairItem
(ItemStack p_361644_) items()
Returns the value of theitems
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
items
The field for theitems
record component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
Repairable
Creates an instance of aRepairable
record class.- Parameters:
items
- the value for theitems
record component
-
-
Method Details
-
isValidRepairItem
-
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 withObjects::equals(Object,Object)
. -
items
Returns the value of theitems
record component.- Returns:
- the value of the
items
record component
-