Record Class ReplaceAction
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.recipe.ingredientaction.ReplaceAction
- All Implemented Interfaces:
IngredientAction
public record ReplaceAction(net.minecraft.world.item.ItemStack item)
extends Record
implements IngredientAction
-
Field Summary
FieldsFields inherited from interface dev.latvian.mods.kubejs.recipe.ingredientaction.IngredientAction
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionReplaceAction(net.minecraft.world.item.ItemStack item) Creates an instance of aReplaceActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackitem()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.world.item.ItemStacktransform(net.minecraft.world.item.ItemStack old, int index, net.minecraft.world.item.crafting.CraftingInput input)
-
Field Details
-
TYPE
-
-
Constructor Details
-
ReplaceAction
public ReplaceAction(net.minecraft.world.item.ItemStack item) Creates an instance of aReplaceActionrecord class.- Parameters:
item- the value for theitemrecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceIngredientAction
-
transform
public net.minecraft.world.item.ItemStack transform(net.minecraft.world.item.ItemStack old, int index, net.minecraft.world.item.crafting.CraftingInput input) - Specified by:
transformin interfaceIngredientAction
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
item
public net.minecraft.world.item.ItemStack item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-