Skip to content

Commit 0722a3a

Browse files
feat: rework recipe modification (#6)
1 parent 46adb12 commit 0722a3a

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

src/main/java/minevalley/crafting/api/recipe/CustomRecipe.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package minevalley.crafting.api.recipe;
22

33
import minevalley.core.api.users.OnlineUser;
4-
import minevalley.crafting.api.ingredient.RecipeIngredient;
54
import org.bukkit.inventory.ItemStack;
65
import org.jetbrains.annotations.Contract;
76

@@ -28,16 +27,6 @@ public interface CustomRecipe {
2827
@Contract(pure = true)
2928
long getCraftingDurationMs();
3029

31-
/**
32-
* Maps a symbol in the recipe shape to a crafting ingredient.
33-
*
34-
* @param symbol the symbol to map
35-
* @param ingredient the crafting ingredient to map to the symbol
36-
* @return this
37-
* @throws IllegalArgumentException if the symbol is already mapped or if the ingredient is null
38-
*/
39-
CustomRecipe mapIngredient(char symbol, @Nonnull RecipeIngredient ingredient) throws IllegalArgumentException;
40-
4130
/**
4231
* Sets a requirement that must be fulfilled by the user trying to craft this recipe.
4332
*

src/main/java/minevalley/crafting/api/recipe/CustomShapedRecipe.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
@SuppressWarnings("unused")
99
public interface CustomShapedRecipe extends CustomRecipe {
1010

11+
/**
12+
* Maps a symbol in the recipe shape to a crafting ingredient.
13+
*
14+
* @param symbol the symbol to map
15+
* @param ingredient the crafting ingredient to map to the symbol
16+
* @return this
17+
* @throws IllegalArgumentException if the symbol is already mapped or if the ingredient is null
18+
*/
19+
CustomShapedRecipe mapIngredient(char symbol, @Nonnull RecipeIngredient ingredient) throws IllegalArgumentException;
20+
1121
/**
1222
* Gets the ingredients arranged in the shape of the recipe.
1323
*
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
package minevalley.crafting.api.recipe;
22

3+
import minevalley.crafting.api.ingredient.RecipeIngredient;
4+
5+
import javax.annotation.Nonnull;
6+
37
@SuppressWarnings("unused")
48
public interface CustomShapelessRecipe extends CustomRecipe {
59

10+
/**
11+
* Adds an ingredient to the recipe.
12+
*
13+
* @param ingredient the ingredient to add
14+
* @return this
15+
* @throws IllegalArgumentException if the ingredient is null
16+
*/
17+
CustomShapelessRecipe addIngredient(@Nonnull RecipeIngredient ingredient) throws IllegalArgumentException;
618
}

0 commit comments

Comments
 (0)