summaryrefslogtreecommitdiffstats
path: root/nms-patches/CraftingManager.patch
blob: c788f8915462a48480174d3541d1c34a2b9311c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- a/net/minecraft/server/CraftingManager.java
+++ b/net/minecraft/server/CraftingManager.java
@@ -96,12 +96,14 @@
 
         do {
             if (!iterator.hasNext()) {
+                iinventory.setCurrentRecipe(null); // CraftBukkit - Clear recipe when no recipe is found
                 return ItemStack.a;
             }
 
             irecipe = (IRecipe) iterator.next();
         } while (!irecipe.a(iinventory, world));
 
+        iinventory.setCurrentRecipe(irecipe); // CraftBukkit
         return irecipe.craftItem(iinventory);
     }
 
@@ -113,12 +115,14 @@
 
         do {
             if (!iterator.hasNext()) {
+                iinventory.setCurrentRecipe(null); // CraftBukkit - Clear recipe when no recipe is found
                 return null;
             }
 
             irecipe = (IRecipe) iterator.next();
         } while (!irecipe.a(iinventory, world));
 
+        iinventory.setCurrentRecipe(irecipe); // CraftBukkit
         return irecipe;
     }