Package dev.jorel.commandapi.wrappers
Record Class ComplexRecipeImpl
java.lang.Object
java.lang.Record
dev.jorel.commandapi.wrappers.ComplexRecipeImpl
- Record Components:
key- the namespaced keyrecipe- the recipe
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed,org.bukkit.inventory.ComplexRecipe,org.bukkit.inventory.Recipe,org.bukkit.Keyed
public record ComplexRecipeImpl(org.bukkit.NamespacedKey key, org.bukkit.inventory.Recipe recipe)
extends Record
implements org.bukkit.inventory.ComplexRecipe
Creates a ComplexRecipe based on a NamespacedKey and a Recipe object.
-
Constructor Summary
ConstructorsConstructorDescriptionComplexRecipeImpl(org.bukkit.NamespacedKey key, org.bukkit.inventory.Recipe recipe) Creates an instance of aComplexRecipeImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NotNull org.bukkit.NamespacedKeygetKey()Return the namespaced identifier for this object.@NotNull org.bukkit.inventory.ItemStackGet the result of this recipe.final inthashCode()Returns a hash code value for this object.org.bukkit.NamespacedKeykey()Returns the value of thekeyrecord component.org.bukkit.inventory.Reciperecipe()Returns the value of thereciperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
getResult
@NotNull public @NotNull org.bukkit.inventory.ItemStack getResult()Get the result of this recipe.- Specified by:
getResultin interfaceorg.bukkit.inventory.Recipe- Returns:
- The result stack
-
getKey
@NotNull public @NotNull org.bukkit.NamespacedKey getKey()Return the namespaced identifier for this object.- Specified by:
getKeyin interfaceorg.bukkit.Keyed- Returns:
- this object's key
-
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). -
key
public org.bukkit.NamespacedKey key()Returns the value of thekeyrecord component.- Specified by:
keyin interfacenet.kyori.adventure.key.Keyed- Specified by:
keyin interfaceorg.bukkit.Keyed- Returns:
- the value of the
keyrecord component
-
recipe
public org.bukkit.inventory.Recipe recipe()Returns the value of thereciperecord component.- Returns:
- the value of the
reciperecord component
-