Package dev.piglin.piglinworldapi.recipe
Record Class SimpleRecipe.SimpleRecipeData
java.lang.Object
java.lang.Record
dev.piglin.piglinworldapi.recipe.SimpleRecipe.SimpleRecipeData
- Enclosing class:
- SimpleRecipe
public static record SimpleRecipe.SimpleRecipeData(@Nullable org.bukkit.inventory.ItemStack ingredient_1_1, @Nullable org.bukkit.inventory.ItemStack ingredient_1_2, @Nullable org.bukkit.inventory.ItemStack ingredient_1_3, @Nullable org.bukkit.inventory.ItemStack ingredient_2_1, @Nullable org.bukkit.inventory.ItemStack ingredient_2_2, @Nullable org.bukkit.inventory.ItemStack ingredient_2_3, @Nullable org.bukkit.inventory.ItemStack ingredient_3_1, @Nullable org.bukkit.inventory.ItemStack ingredient_3_2, @Nullable org.bukkit.inventory.ItemStack ingredient_3_3, @NotNull org.bukkit.inventory.ItemStack result, boolean shaped, boolean needCraftingTable)
extends Record
Recipe ingredients and data
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleRecipeData(@Nullable org.bukkit.inventory.ItemStack ingredient_1_1, @Nullable org.bukkit.inventory.ItemStack ingredient_1_2, @Nullable org.bukkit.inventory.ItemStack ingredient_1_3, @Nullable org.bukkit.inventory.ItemStack ingredient_2_1, @Nullable org.bukkit.inventory.ItemStack ingredient_2_2, @Nullable org.bukkit.inventory.ItemStack ingredient_2_3, @Nullable org.bukkit.inventory.ItemStack ingredient_3_1, @Nullable org.bukkit.inventory.ItemStack ingredient_3_2, @Nullable org.bukkit.inventory.ItemStack ingredient_3_3, @NotNull org.bukkit.inventory.ItemStack result, boolean shaped)If the recipe is 2x2, the ingredients must be placed in ingredient_1_1, ingredient_1_2, ingredient_2_1, ingredient_2_2, and other ingredients must be nullSimpleRecipeData(@Nullable org.bukkit.inventory.ItemStack ingredient_1_1, @Nullable org.bukkit.inventory.ItemStack ingredient_1_2, @Nullable org.bukkit.inventory.ItemStack ingredient_1_3, @Nullable org.bukkit.inventory.ItemStack ingredient_2_1, @Nullable org.bukkit.inventory.ItemStack ingredient_2_2, @Nullable org.bukkit.inventory.ItemStack ingredient_2_3, @Nullable org.bukkit.inventory.ItemStack ingredient_3_1, @Nullable org.bukkit.inventory.ItemStack ingredient_3_2, @Nullable org.bukkit.inventory.ItemStack ingredient_3_3, @NotNull org.bukkit.inventory.ItemStack result, boolean shaped, boolean needCraftingTable)Creates an instance of aSimpleRecipeDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_1_1record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_1_2record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_1_3record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_2_1record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_2_2record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_2_3record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_3_1record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_3_2record component.@Nullable org.bukkit.inventory.ItemStackReturns the value of theingredient_3_3record component.booleanReturns the value of theneedCraftingTablerecord component.@NotNull org.bukkit.inventory.ItemStackresult()Returns the value of theresultrecord component.booleanshaped()Returns the value of theshapedrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
SimpleRecipeData
public SimpleRecipeData(@Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_1_1, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_1_2, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_1_3, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_2_1, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_2_2, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_2_3, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_3_1, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_3_2, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_3_3, @NotNull @NotNull org.bukkit.inventory.ItemStack result, boolean shaped)If the recipe is 2x2, the ingredients must be placed in ingredient_1_1, ingredient_1_2, ingredient_2_1, ingredient_2_2, and other ingredients must be null- Parameters:
ingredient_1_1- Ingredient at left top corneringredient_1_2- Ingredient at top corneringredient_1_3- Ingredient at right top corneringredient_2_1- Ingredient at left corneringredient_2_2- Ingredient at the middleingredient_2_3- Ingredient at right corneringredient_3_1- Ingredient at left bottom corneringredient_3_2- Ingredient at bottom corneringredient_3_3- Ingredient at right bottom cornerresult- The resultshaped- True if shaped, false if the shape and order don't matter
-
SimpleRecipeData
public SimpleRecipeData(@Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_1_1, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_1_2, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_1_3, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_2_1, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_2_2, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_2_3, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_3_1, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_3_2, @Nullable @Nullable org.bukkit.inventory.ItemStack ingredient_3_3, @NotNull @NotNull org.bukkit.inventory.ItemStack result, boolean shaped, boolean needCraftingTable)Creates an instance of aSimpleRecipeDatarecord class.- Parameters:
ingredient_1_1- the value for theingredient_1_1record componentingredient_1_2- the value for theingredient_1_2record componentingredient_1_3- the value for theingredient_1_3record componentingredient_2_1- the value for theingredient_2_1record componentingredient_2_2- the value for theingredient_2_2record componentingredient_2_3- the value for theingredient_2_3record componentingredient_3_1- the value for theingredient_3_1record componentingredient_3_2- the value for theingredient_3_2record componentingredient_3_3- the value for theingredient_3_3record componentresult- the value for theresultrecord componentshaped- the value for theshapedrecord componentneedCraftingTable- the value for theneedCraftingTablerecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ingredient_1_1
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_1_1()Returns the value of theingredient_1_1record component.- Returns:
- the value of the
ingredient_1_1record component
-
ingredient_1_2
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_1_2()Returns the value of theingredient_1_2record component.- Returns:
- the value of the
ingredient_1_2record component
-
ingredient_1_3
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_1_3()Returns the value of theingredient_1_3record component.- Returns:
- the value of the
ingredient_1_3record component
-
ingredient_2_1
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_2_1()Returns the value of theingredient_2_1record component.- Returns:
- the value of the
ingredient_2_1record component
-
ingredient_2_2
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_2_2()Returns the value of theingredient_2_2record component.- Returns:
- the value of the
ingredient_2_2record component
-
ingredient_2_3
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_2_3()Returns the value of theingredient_2_3record component.- Returns:
- the value of the
ingredient_2_3record component
-
ingredient_3_1
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_3_1()Returns the value of theingredient_3_1record component.- Returns:
- the value of the
ingredient_3_1record component
-
ingredient_3_2
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_3_2()Returns the value of theingredient_3_2record component.- Returns:
- the value of the
ingredient_3_2record component
-
ingredient_3_3
@Nullable public @Nullable org.bukkit.inventory.ItemStack ingredient_3_3()Returns the value of theingredient_3_3record component.- Returns:
- the value of the
ingredient_3_3record component
-
result
@NotNull public @NotNull org.bukkit.inventory.ItemStack result()Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
shaped
public boolean shaped()Returns the value of theshapedrecord component.- Returns:
- the value of the
shapedrecord component
-
needCraftingTable
public boolean needCraftingTable()Returns the value of theneedCraftingTablerecord component.- Returns:
- the value of the
needCraftingTablerecord component
-