Skip to content

Commit 8f62413

Browse files
committed
Fixed recipe
1 parent f695db1 commit 8f62413

File tree

1 file changed

+9
-15
lines changed
  • src/main/java/org/spongepowered/api/item/recipe

1 file changed

+9
-15
lines changed

src/main/java/org/spongepowered/api/item/recipe/Recipe.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
package org.spongepowered.api.item.recipe;
2626

27+
import org.spongepowered.api.ResourceKey;
2728
import org.spongepowered.api.block.BlockTypes;
2829
import org.spongepowered.api.block.entity.carrier.Campfire;
2930
import org.spongepowered.api.block.entity.carrier.furnace.BlastFurnace;
@@ -33,13 +34,7 @@
3334
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
3435
import org.spongepowered.api.item.inventory.crafting.CraftingInventory;
3536
import 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.*;
4338
import org.spongepowered.api.item.recipe.single.StoneCutterRecipe;
4439
import org.spongepowered.api.item.recipe.smithing.SmithingRecipe;
4540
import org.spongepowered.api.world.server.ServerWorld;
@@ -59,12 +54,13 @@
5954
*/
6055
public 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

Comments
 (0)