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 ItemStack
The field for theconvertInto
record component.static final StreamCodec
<RegistryFriendlyByteBuf, UseRemainder> -
Constructor Summary
ConstructorsConstructorDescriptionUseRemainder
(ItemStack convertInto) Creates an instance of aUseRemainder
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconvertInto
record component.convertIntoRemainder
(ItemStack p_366873_, int p_366665_, boolean p_376140_, UseRemainder.OnExtraCreatedRemainder p_376106_) boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
convertInto
The field for theconvertInto
record component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
UseRemainder
Creates an instance of aUseRemainder
record class.- Parameters:
convertInto
- the value for theconvertInto
record component
-
-
Method Details
-
convertIntoRemainder
public ItemStack convertIntoRemainder(ItemStack p_366873_, int p_366665_, boolean p_376140_, UseRemainder.OnExtraCreatedRemainder p_376106_) -
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 theconvertInto
record component.- Returns:
- the value of the
convertInto
record component
-