Record Class ModifiedIngredient
java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.ModifiedIngredient
- All Implemented Interfaces:
net.neoforged.neoforge.common.crafting.ICustomIngredient
public record ModifiedIngredient(net.minecraft.world.item.crafting.Ingredient ingredient, List<IIngredientModifier<? super net.minecraft.world.item.ItemStack>> modifiers)
extends Record
implements net.neoforged.neoforge.common.crafting.ICustomIngredient
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ModifiedIngredient> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ModifiedIngredient> -
Constructor Summary
ConstructorsConstructorDescriptionModifiedIngredient(net.minecraft.world.item.crafting.Ingredient ingredient, List<IIngredientModifier<? super net.minecraft.world.item.ItemStack>> modifiers) Creates an instance of aModifiedIngredientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Stream<net.minecraft.world.item.ItemStack> getItems()net.neoforged.neoforge.common.crafting.IngredientType<ModifiedIngredient> getType()final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.crafting.IngredientReturns the value of theingredientrecord component.booleanisSimple()List<IIngredientModifier<? super net.minecraft.world.item.ItemStack>> Returns the value of themodifiersrecord component.booleantest(net.minecraft.world.item.ItemStack stack) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.crafting.ICustomIngredient
toVanilla
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ModifiedIngredient> STREAM_CODEC
-
-
Constructor Details
-
ModifiedIngredient
public ModifiedIngredient(net.minecraft.world.item.crafting.Ingredient ingredient, List<IIngredientModifier<? super net.minecraft.world.item.ItemStack>> modifiers) Creates an instance of aModifiedIngredientrecord class.- Parameters:
ingredient- the value for theingredientrecord componentmodifiers- the value for themodifiersrecord component
-
-
Method Details
-
test
public boolean test(@Nonnull net.minecraft.world.item.ItemStack stack) - Specified by:
testin interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
getItems
- Specified by:
getItemsin interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
isSimple
public boolean isSimple()- Specified by:
isSimplein interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
getType
- Specified by:
getTypein interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
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). -
ingredient
public net.minecraft.world.item.crafting.Ingredient ingredient()Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-