2424 */
2525package org .spongepowered .api .item .recipe ;
2626
27+ import org .spongepowered .api .ResourceKey ;
2728import org .spongepowered .api .block .BlockTypes ;
2829import org .spongepowered .api .block .entity .carrier .Campfire ;
2930import org .spongepowered .api .block .entity .carrier .furnace .BlastFurnace ;
3334import org .spongepowered .api .item .inventory .ItemStackSnapshot ;
3435import org .spongepowered .api .item .inventory .crafting .CraftingInventory ;
3536import org .spongepowered .api .item .recipe .cooking .CookingRecipe ;
36- import org .spongepowered .api .item .recipe .crafting .CraftingRecipe ;
37- import org .spongepowered .api .item .recipe .crafting .Ingredient ;
38- import org .spongepowered .api .item .recipe .crafting .RecipeInput ;
39- import org .spongepowered .api .item .recipe .crafting .RecipeResult ;
40- import org .spongepowered .api .item .recipe .crafting .ShapedCraftingRecipe ;
41- import org .spongepowered .api .item .recipe .crafting .ShapelessCraftingRecipe ;
42- import org .spongepowered .api .item .recipe .crafting .SpecialCraftingRecipe ;
37+ import org .spongepowered .api .item .recipe .crafting .*;
4338import org .spongepowered .api .item .recipe .single .StoneCutterRecipe ;
4439import org .spongepowered .api .item .recipe .smithing .SmithingRecipe ;
4540import org .spongepowered .api .world .server .ServerWorld ;
5954 */
6055public interface Recipe <T extends RecipeInput > {
6156
57+ Optional <ResourceKey > key ();
58+
6259 /**
6360 * Checks if the given inventory fits the required constraints to make a valid recipe
6461 *
6562 * @param inventory The inventory to check for validity
66- * @param world The world this recipe would be used in
67- *
63+ * @param world The world this recipe would be used in
6864 * @return True if the given input matches this recipe's requirements
6965 */
7066 boolean isValid (T inventory , ServerWorld world );
@@ -77,7 +73,6 @@ public interface Recipe<T extends RecipeInput> {
7773 * as it may customize the result further depending on the context.</p>
7874 *
7975 * @param inventory The input inventory
80- *
8176 * @return The result of this recipe
8277 */
8378 ItemStackSnapshot result (T inventory );
@@ -100,7 +95,7 @@ public interface Recipe<T extends RecipeInput> {
10095 *
10196 * @param inventory The input inventory
10297 * @return The list of items to be added to the inventory of the player
103- * when the recipe has been fulfilled (possibly empty)
98+ * when the recipe has been fulfilled (possibly empty)
10499 */
105100 List <ItemStackSnapshot > remainingItems (T inventory );
106101
@@ -111,11 +106,10 @@ public interface Recipe<T extends RecipeInput> {
111106 * {@link #isValid(RecipeInput, ServerWorld)}.</p>
112107 *
113108 * @param inventory The input inventory
114- * @param world The world this recipe would be used in
115- *
109+ * @param world The world this recipe would be used in
116110 * @return A {@link RecipeResult} if the arguments satisfy
117- * {@link #isValid(RecipeInput, ServerWorld)}, or
118- * {@link Optional#empty()} if not
111+ * {@link #isValid(RecipeInput, ServerWorld)}, or
112+ * {@link Optional#empty()} if not
119113 */
120114 default Optional <RecipeResult > result (T inventory , ServerWorld world ) {
121115 if (this .isValid (inventory , world )) {
0 commit comments