Record Class ExampleRecipe

java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ExampleRecipe
All Implemented Interfaces:
IDummyRecipe, net.minecraft.world.item.crafting.Recipe<net.neoforged.neoforge.items.wrapper.RecipeWrapper>

public record ExampleRecipe(com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient> ingredient, com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack> result) extends Record implements IDummyRecipe
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<ExampleRecipe>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient>>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack>>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ExampleRecipe>
     

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

    CONDITIONAL_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExampleRecipe(com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient> ingredient, com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack> result)
    Creates an instance of a ExampleRecipe record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.item.crafting.RecipeSerializer<ExampleRecipe>
     
    net.minecraft.world.item.crafting.RecipeType<ExampleRecipe>
     
    final int
    Returns a hash code value for this object.
    com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient>
    Returns the value of the ingredient record component.
    com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack>
    Returns the value of the result record component.
    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 com.petrolpark.core.recipe.IDummyRecipe

    assemble, canCraftInDimensions, getResultItem, matches

    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<ExampleRecipe> CODEC
    • INGREDIENT_STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient>> INGREDIENT_STREAM_CODEC
    • RESULT_STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack>> RESULT_STREAM_CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ExampleRecipe> STREAM_CODEC
  • Constructor Details

    • ExampleRecipe

      public ExampleRecipe(com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient> ingredient, com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack> result)
      Creates an instance of a ExampleRecipe record class.
      Parameters:
      ingredient - the value for the ingredient record component
      result - the value for the result record component
  • Method Details

    • getSerializer

      public net.minecraft.world.item.crafting.RecipeSerializer<ExampleRecipe> getSerializer()
      Specified by:
      getSerializer in interface net.minecraft.world.item.crafting.Recipe<net.neoforged.neoforge.items.wrapper.RecipeWrapper>
    • getType

      public net.minecraft.world.item.crafting.RecipeType<ExampleRecipe> getType()
      Specified by:
      getType in interface net.minecraft.world.item.crafting.Recipe<net.neoforged.neoforge.items.wrapper.RecipeWrapper>
    • 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 com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient> ingredient()
      Returns the value of the ingredient record component.
      Returns:
      the value of the ingredient record component
    • result

      public com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack> result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component