Record Class TransmuteResult
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.TransmuteResult
public record TransmuteResult(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.private static final com.mojang.serialization.Codec<TransmuteResult> The field for theitemrecord component.static final StreamCodec<RegistryFriendlyByteBuf, TransmuteResult> -
Constructor Summary
ConstructorsConstructorDescriptionTransmuteResult(Holder<Item> item, int count, DataComponentPatch components) Creates an instance of aTransmuteResultrecord class.TransmuteResult(Item p_394464_) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentsrecord component.intcount()Returns the value of thecountrecord component.display()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisResultUnchanged(ItemStack pStack) item()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.private static com.mojang.serialization.DataResult<TransmuteResult> validate(TransmuteResult p_394435_)
-
Field Details
-
item
The field for theitemrecord component. -
count
private final int countThe field for thecountrecord component. -
components
The field for thecomponentsrecord component. -
FULL_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
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
-
validate
private static com.mojang.serialization.DataResult<TransmuteResult> validate(TransmuteResult p_394435_) -
apply
-
isResultUnchanged
-
display
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
item
Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
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
-