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 ItemStackTemplateThe field for theconvertIntorecord component.static final StreamCodec<RegistryFriendlyByteBuf, UseRemainder> -
Constructor Summary
ConstructorsConstructorDescriptionUseRemainder(ItemStackTemplate convertInto) Creates an instance of aUseRemainderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconvertIntorecord component.convertIntoRemainder(ItemStack usedStack, int stackCountBeforeUsing, boolean hasInfiniteMaterials, UseRemainder.OnExtraCreatedRemainder onExtraCreatedRemainder) 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.
-
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 usedStack, int stackCountBeforeUsing, boolean hasInfiniteMaterials, UseRemainder.OnExtraCreatedRemainder onExtraCreatedRemainder) -
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 withObjects::equals(Object,Object). -
convertInto
Returns the value of theconvertIntorecord component.- Returns:
- the value of the
convertIntorecord component
-