Record Class UseRemainder
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.UseRemainder
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<UseRemainder> private final ItemStackThe field for theconvertIntorecord component.static final StreamCodec<RegistryFriendlyByteBuf, UseRemainder> -
Constructor Summary
ConstructorsConstructorDescriptionUseRemainder(ItemStack convertInto) Creates an instance of aUseRemainderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconvertIntorecord component.convertIntoRemainder(ItemStack pStack, int pCount, boolean pHasInfiniteMaterials, UseRemainder.OnExtraCreatedRemainder pOnExtraCreated) booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
convertInto
The field for theconvertIntorecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
UseRemainder
Creates an instance of aUseRemainderrecord class.- Parameters:
convertInto- the value for theconvertIntorecord component
-
-
Method Details
-
convertIntoRemainder
public ItemStack convertIntoRemainder(ItemStack pStack, int pCount, boolean pHasInfiniteMaterials, UseRemainder.OnExtraCreatedRemainder pOnExtraCreated) -
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
convertInto
Returns the value of theconvertIntorecord component.- Returns:
- the value of the
convertIntorecord component
-