Skip to content

Commit 5f5df00

Browse files
authored
chore: add return value to recipe methods (#5)
1 parent 318e9d2 commit 5f5df00

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,26 @@ public interface CustomRecipe {
3333
*
3434
* @param symbol the symbol to map
3535
* @param ingredient the crafting ingredient to map to the symbol
36+
* @return this
3637
* @throws IllegalArgumentException if the symbol is already mapped or if the ingredient is null
3738
*/
38-
void mapIngredient(char symbol, @Nonnull RecipeIngredient ingredient) throws IllegalArgumentException;
39+
CustomRecipe mapIngredient(char symbol, @Nonnull RecipeIngredient ingredient) throws IllegalArgumentException;
3940

4041
/**
4142
* Sets a requirement that must be fulfilled by the user trying to craft this recipe.
4243
*
4344
* @param requirement the requirement predicate
45+
* @return this
4446
* @throws IllegalArgumentException if the requirement is null
4547
*/
46-
void require(@Nonnull Predicate<OnlineUser> requirement) throws IllegalArgumentException;
48+
CustomRecipe require(@Nonnull Predicate<OnlineUser> requirement) throws IllegalArgumentException;
4749

4850
/**
4951
* Removes all requirements for crafting this recipe.
52+
* @return this
5053
*/
51-
default void removeRequirements() {
52-
require(user -> true);
54+
default CustomRecipe removeRequirements() {
55+
return require(user -> true);
5356
}
5457

5558
/**

0 commit comments

Comments
 (0)