Package com.petrolpark.core.recipe
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
FieldsModifier and TypeFieldDescriptionstatic 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
ConstructorsConstructorDescriptionExampleRecipe(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 aExampleReciperecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.crafting.RecipeSerializer<ExampleRecipe> net.minecraft.world.item.crafting.RecipeType<ExampleRecipe> getType()final inthashCode()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 theingredientrecord component.com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack, net.neoforged.neoforge.fluids.FluidStack> result()Returns the value of theresultrecord component.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.IDummyRecipe
assemble, canCraftInDimensions, getResultItem, matchesMethods inherited from interface net.minecraft.world.item.crafting.Recipe
getGroup, getIngredients, getRemainingItems, getToastSymbol, isIncomplete, isSpecial, showNotification
-
Field Details
-
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, INGREDIENT_STREAM_CODECnet.neoforged.neoforge.fluids.crafting.SizedFluidIngredient>> -
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, RESULT_STREAM_CODECnet.neoforged.neoforge.fluids.FluidStack>> -
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 aExampleReciperecord class.- Parameters:
ingredient- the value for theingredientrecord componentresult- the value for theresultrecord component
-
-
Method Details
-
getSerializer
- Specified by:
getSerializerin interfacenet.minecraft.world.item.crafting.Recipe<net.neoforged.neoforge.items.wrapper.RecipeWrapper>
-
getType
- Specified by:
getTypein interfacenet.minecraft.world.item.crafting.Recipe<net.neoforged.neoforge.items.wrapper.RecipeWrapper>
-
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 com.mojang.datafixers.util.Either<net.minecraft.world.item.crafting.Ingredient,net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient> ingredient()Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-
result
public com.mojang.datafixers.util.Either<net.minecraft.world.item.ItemStack,net.neoforged.neoforge.fluids.FluidStack> result()Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-