Record Class DoughItemAdvancedIngredient
java.lang.Object
java.lang.Record
com.petrolpark.compat.create.core.dough.ingredient.DoughItemAdvancedIngredient
- All Implemented Interfaces:
IAdvancedIngredient<net.minecraft.world.item.ItemStack>,IForcingItemAdvancedIngredient,ItemAdvancedIngredient,ITypelessAdvancedIngredient<net.minecraft.world.item.ItemStack>,Predicate<net.minecraft.world.item.ItemStack>
public record DoughItemAdvancedIngredient(List<IAdvancedIngredient<DoughData>> doughIngredients)
extends Record
implements ItemAdvancedIngredient
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<DoughItemAdvancedIngredient> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, DoughItemAdvancedIngredient> Fields inherited from interface com.petrolpark.core.recipe.ingredient.advanced.ItemAdvancedIngredient
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionDoughItemAdvancedIngredient(List<IAdvancedIngredient<DoughData>> doughIngredients) Creates an instance of aDoughItemAdvancedIngredientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToCounterDescription(Lang.IndentedTooltipBuilder description) voidaddToDescription(Lang.IndentedTooltipBuilder description) Returns the value of thedoughIngredientsrecord component.final booleanIndicates whether some other object is "equal to" this one.INamedAdvancedIngredientType<net.minecraft.world.item.ItemStack> getType()final inthashCode()Returns a hash code value for this object.Stream<net.minecraft.world.item.ItemStack> modifyCounterExamples(Stream<net.minecraft.world.item.ItemStack> counterExampleStacks) Modify an example stack so it does notfulfillthisIAdvancedIngredient.Stream<net.minecraft.world.item.ItemStack> modifyExamples(Stream<net.minecraft.world.item.ItemStack> exampleStacks) Modify an example stack so itfulfillthisIAdvancedIngredient.Stream<? extends net.minecraft.world.item.ItemStack> All (or an exemplary subset) of the stacks which do notfulfillthisIAdvancedIngredient.Stream<? extends net.minecraft.world.item.ItemStack> All (or an exemplary subset) of the stacks whichfulfillthisIAdvancedIngredient.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 com.petrolpark.core.recipe.ingredient.advanced.IAdvancedIngredient
simplifyMethods inherited from interface com.petrolpark.core.recipe.ingredient.advanced.ItemAdvancedIngredient
forbidLootItemFunction, forbidTradeListing, forceLootItemFunction, forceTradeListing, translate, translateInverse, translateSimpleMethods inherited from interface com.petrolpark.core.recipe.ingredient.advanced.ITypelessAdvancedIngredient
checkedCast
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,DoughItemAdvancedIngredient> STREAM_CODEC
-
-
Constructor Details
-
DoughItemAdvancedIngredient
Creates an instance of aDoughItemAdvancedIngredientrecord class.- Parameters:
doughIngredients- the value for thedoughIngredientsrecord component
-
-
Method Details
-
addToDescription
- Specified by:
addToDescriptionin interfaceITypelessAdvancedIngredient<net.minecraft.world.item.ItemStack>
-
addToCounterDescription
- Specified by:
addToCounterDescriptionin interfaceITypelessAdvancedIngredient<net.minecraft.world.item.ItemStack>
-
test
public boolean test(net.minecraft.world.item.ItemStack stack) - Specified by:
testin interfaceItemAdvancedIngredient- Specified by:
testin interfacePredicate<net.minecraft.world.item.ItemStack>
-
streamExamples
Description copied from interface:ITypelessAdvancedIngredientAll (or an exemplary subset) of the stacks whichfulfillthisIAdvancedIngredient. This is not guaranteed to have every possible stack, and should never be used that way.- Specified by:
streamExamplesin interfaceITypelessAdvancedIngredient<net.minecraft.world.item.ItemStack>- Returns:
- Non-
null, potentially empty Stream
-
streamCounterExamples
Description copied from interface:ITypelessAdvancedIngredientAll (or an exemplary subset) of the stacks which do notfulfillthisIAdvancedIngredient. This is not guaranteed to have every possible stack (and in fact will usually be empty), and should never be used that way.- Specified by:
streamCounterExamplesin interfaceITypelessAdvancedIngredient<net.minecraft.world.item.ItemStack>- Returns:
- Non-
null, potentially empty Stream
-
modifyExamples
public Stream<net.minecraft.world.item.ItemStack> modifyExamples(Stream<net.minecraft.world.item.ItemStack> exampleStacks) Description copied from interface:ITypelessAdvancedIngredientModify an example stack so itfulfillthisIAdvancedIngredient.- Specified by:
modifyExamplesin interfaceITypelessAdvancedIngredient<net.minecraft.world.item.ItemStack>- Parameters:
exampleStacks- May be modified- Returns:
- A stack fulfilling this Ingredient, possibly the same object reference, or
nullif that stack can never fulfill this Ingredient
-
modifyCounterExamples
public Stream<net.minecraft.world.item.ItemStack> modifyCounterExamples(Stream<net.minecraft.world.item.ItemStack> counterExampleStacks) Description copied from interface:ITypelessAdvancedIngredientModify an example stack so it does notfulfillthisIAdvancedIngredient.- Specified by:
modifyCounterExamplesin interfaceITypelessAdvancedIngredient<net.minecraft.world.item.ItemStack>- Parameters:
counterExampleStacks- May be modified- Returns:
- A stack not fulfilling this Ingredient, possibly the same object reference, or
nullif that stack always fulfills this Ingredient
-
getType
- Specified by:
getTypein interfaceIAdvancedIngredient<net.minecraft.world.item.ItemStack>- Specified by:
getTypein interfaceItemAdvancedIngredient
-
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). -
doughIngredients
Returns the value of thedoughIngredientsrecord component.- Returns:
- the value of the
doughIngredientsrecord component
-