Package com.wdiscute.artisan.upgrades
Record Class TransmuteResultUpgrade.TransmuteResult
java.lang.Object
java.lang.Record
com.wdiscute.artisan.upgrades.TransmuteResultUpgrade.TransmuteResult
- Enclosing class:
TransmuteResultUpgrade
public static record TransmuteResultUpgrade.TransmuteResult(net.minecraft.world.item.crafting.Ingredient original, net.minecraft.world.item.ItemStack transmuted, float chance)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TransmuteResultUpgrade.TransmuteResult> -
Constructor Summary
ConstructorsConstructorDescriptionTransmuteResult(net.minecraft.world.item.crafting.Ingredient original, net.minecraft.world.item.ItemStack transmuted, float chance) Creates an instance of aTransmuteResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatchance()Returns the value of thechancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.crafting.Ingredientoriginal()Returns the value of theoriginalrecord component.final StringtoString()Returns a string representation of this record class.voidtransmute(List<net.minecraft.world.item.ItemStack> results, net.minecraft.util.RandomSource randomSource) net.minecraft.world.item.ItemStackReturns the value of thetransmutedrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
TransmuteResult
public TransmuteResult(net.minecraft.world.item.crafting.Ingredient original, net.minecraft.world.item.ItemStack transmuted, float chance) Creates an instance of aTransmuteResultrecord class.- Parameters:
original- the value for theoriginalrecord componenttransmuted- the value for thetransmutedrecord componentchance- the value for thechancerecord component
-
-
Method Details
-
transmute
public void transmute(List<net.minecraft.world.item.ItemStack> results, net.minecraft.util.RandomSource randomSource) -
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 '=='. -
original
public net.minecraft.world.item.crafting.Ingredient original()Returns the value of theoriginalrecord component.- Returns:
- the value of the
originalrecord component
-
transmuted
public net.minecraft.world.item.ItemStack transmuted()Returns the value of thetransmutedrecord component.- Returns:
- the value of the
transmutedrecord component
-
chance
public float chance()Returns the value of thechancerecord component.- Returns:
- the value of the
chancerecord component
-