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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    AgeingRecipe(net.minecraft.world.item.crafting.Ingredient ingredient, IDecayProduct product, DecayTime decayTime)
    Creates an instance of a AgeingRecipe record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.ItemStack
    assemble(net.minecraft.world.item.crafting.SingleRecipeInput input, boolean startDecay)
     
    net.minecraft.world.item.ItemStack
    assemble(net.minecraft.world.item.crafting.SingleRecipeInput input, net.minecraft.core.HolderLookup.Provider registries)
     
    boolean
    canCraftInDimensions(int width, int height)
     
    static final AgeingRecipe
    cast(net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput> recipe)
     
    Returns the value of the decayTime record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.item.ItemStack
    getResultItem(net.minecraft.core.HolderLookup.Provider registries)
     
    net.minecraft.world.item.crafting.RecipeSerializer<AgeingRecipe>
     
    net.minecraft.world.item.crafting.RecipeType<AgeingRecipe>
     
    final int
    Returns a hash code value for this object.
    net.minecraft.world.item.crafting.Ingredient
    Returns the value of the ingredient record component.
    boolean
    matches(net.minecraft.world.item.crafting.SingleRecipeInput input, net.minecraft.world.level.Level level)
    Must be passed the true ItemStack.
    Returns the value of the product record component.
    net.minecraft.world.item.ItemStack
    setDecayProductAndTime(net.minecraft.world.item.ItemStack stack)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.item.crafting.Recipe

    getGroup, getIngredients, getRemainingItems, getToastSymbol, isIncomplete, isSpecial, showNotification
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<AgeingRecipe> 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 a AgeingRecipe record class.
      Parameters:
      ingredient - the value for the ingredient record component
      product - the value for the product record component
      decayTime - the value for the decayTime record 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 the true ItemStack.
      Specified by:
      matches in interface net.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:
      assemble in interface net.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:
      canCraftInDimensions in interface net.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:
      getResultItem in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
    • getSerializer

      public net.minecraft.world.item.crafting.RecipeSerializer<AgeingRecipe> getSerializer()
      Specified by:
      getSerializer in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.SingleRecipeInput>
    • getType

      public net.minecraft.world.item.crafting.RecipeType<AgeingRecipe> getType()
      Specified by:
      getType in interface net.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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • ingredient

      public net.minecraft.world.item.crafting.Ingredient ingredient()
      Returns the value of the ingredient record component.
      Returns:
      the value of the ingredient record component
    • product

      public IDecayProduct product()
      Returns the value of the product record component.
      Returns:
      the value of the product record component
    • decayTime

      public DecayTime decayTime()
      Returns the value of the decayTime record component.
      Returns:
      the value of the decayTime record component