Record Class TransmuteResult
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.TransmuteResult
public record TransmuteResult(Optional<Holder<Item>> item, int count, DataComponentPatch components)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TransmuteResult> private final DataComponentPatchThe field for thecomponentsrecord component.private final intThe field for thecountrecord component.The field for theitemrecord component.static final TransmuteResultstatic final com.mojang.serialization.MapCodec<TransmuteResult> static final StreamCodec<RegistryFriendlyByteBuf, TransmuteResult> -
Constructor Summary
ConstructorsConstructorDescriptionTransmuteResult(Optional<Holder<Item>> item, int count, DataComponentPatch components) Creates an instance of aTransmuteResultrecord class.TransmuteResult(Holder<Item> item) TransmuteResult(Item item) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentsrecord component.intcount()Returns the value of thecountrecord component.final booleanIndicates whether some other object is "equal to" this one.static TransmuteResultfromTemplate(ItemStackTemplate template) final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
item
-
count
private final int countThe field for thecountrecord component. -
components
The field for thecomponentsrecord component. -
MAP_CODEC
-
CODEC
-
STREAM_CODEC
-
KEEP_INPUT_ITEM
-
-
Constructor Details
-
TransmuteResult
-
TransmuteResult
-
TransmuteResult
Creates an instance of aTransmuteResultrecord class.- Parameters:
item- the value for theitemrecord componentcount- the value for thecountrecord componentcomponents- the value for thecomponentsrecord component
-
-
Method Details
-
fromTemplate
-
resolve
-
resolve
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
item
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-