Record Class AdvancedItemIngredient
java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.AdvancedItemIngredient
- All Implemented Interfaces:
net.neoforged.neoforge.common.crafting.ICustomIngredient
public record AdvancedItemIngredient(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> advacnedIngredient)
extends Record
implements net.neoforged.neoforge.common.crafting.ICustomIngredient
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<AdvancedItemIngredient> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, AdvancedItemIngredient> -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedItemIngredient(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> advacnedIngredient) Creates an instance of aAdvancedItemIngredientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionIAdvancedIngredient<? super net.minecraft.world.item.ItemStack> Returns the value of theadvacnedIngredientrecord component.final booleanIndicates whether some other object is "equal to" this one.Stream<net.minecraft.world.item.ItemStack> getItems()net.neoforged.neoforge.common.crafting.IngredientType<AdvancedItemIngredient> getType()final inthashCode()Returns a hash code value for this object.booleanisSimple()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,AdvancedItemIngredient> STREAM_CODEC
-
-
Constructor Details
-
AdvancedItemIngredient
public AdvancedItemIngredient(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> advacnedIngredient) Creates an instance of aAdvancedItemIngredientrecord class.- Parameters:
advacnedIngredient- the value for theadvacnedIngredientrecord 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). -
advacnedIngredient
Returns the value of theadvacnedIngredientrecord component.- Returns:
- the value of the
advacnedIngredientrecord component
-