Record Class AgeingRecipe
java.lang.Object
java.lang.Record
com.petrolpark.core.item.decay.ageing.AgeingRecipe
- All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
public record AgeingRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, IDecayProduct product, DecayTime decayTime)
extends Record
implements net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<AgeingRecipe> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, AgeingRecipe> Fields inherited from interface net.minecraft.world.item.crafting.Recipe
CONDITIONAL_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionAgeingRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, IDecayProduct product, DecayTime decayTime) Creates an instance of aAgeingReciperecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackassemble(net.minecraft.world.item.crafting.SingleRecipeInput input, boolean startDecay) net.minecraft.world.item.ItemStackassemble(net.minecraft.world.item.crafting.SingleRecipeInput input, net.minecraft.core.HolderLookup.Provider registries) booleancanCraftInDimensions(int width, int height) static final AgeingRecipecast(net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput> recipe) Returns the value of thedecayTimerecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.ItemStackgetResultItem(net.minecraft.core.HolderLookup.Provider registries) net.minecraft.world.item.crafting.RecipeSerializer<AgeingRecipe> net.minecraft.world.item.crafting.RecipeType<AgeingRecipe> getType()final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.crafting.IngredientReturns the value of theingredientrecord component.booleanmatches(net.minecraft.world.item.crafting.SingleRecipeInput input, net.minecraft.world.level.Level level) Must be passed thetrueItemStack.product()Returns the value of theproductrecord component.net.minecraft.world.item.ItemStacksetDecayProductAndTime(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.minecraft.world.item.crafting.Recipe
getGroup, getIngredients, getRemainingItems, getToastSymbol, isIncomplete, isSpecial, showNotification
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,AgeingRecipe> STREAM_CODEC
-
-
Constructor Details
-
AgeingRecipe
public AgeingRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, IDecayProduct product, DecayTime decayTime) Creates an instance of aAgeingReciperecord class.- Parameters:
ingredient- the value for theingredientrecord componentproduct- the value for theproductrecord componentdecayTime- the value for thedecayTimerecord component
-
-
Method Details
-
matches
public boolean matches(@Nonnull net.minecraft.world.item.crafting.SingleRecipeInput input, @Nonnull net.minecraft.world.level.Level level) Must be passed thetrueItemStack.- Specified by:
matchesin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
-
setDecayProductAndTime
public net.minecraft.world.item.ItemStack setDecayProductAndTime(net.minecraft.world.item.ItemStack stack) -
assemble
public net.minecraft.world.item.ItemStack assemble(@Nonnull net.minecraft.world.item.crafting.SingleRecipeInput input, @Nonnull net.minecraft.core.HolderLookup.Provider registries) - Specified by:
assemblein interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
-
assemble
public net.minecraft.world.item.ItemStack assemble(@Nonnull net.minecraft.world.item.crafting.SingleRecipeInput input, boolean startDecay) -
canCraftInDimensions
public boolean canCraftInDimensions(int width, int height) - Specified by:
canCraftInDimensionsin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
-
getResultItem
public net.minecraft.world.item.ItemStack getResultItem(@Nonnull net.minecraft.core.HolderLookup.Provider registries) - Specified by:
getResultItemin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
-
getSerializer
- Specified by:
getSerializerin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
-
getType
- Specified by:
getTypein interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
-
cast
public static final AgeingRecipe cast(net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput> recipe) -
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
-
product
Returns the value of theproductrecord component.- Returns:
- the value of the
productrecord component
-
decayTime
Returns the value of thedecayTimerecord component.- Returns:
- the value of the
decayTimerecord component
-