2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/CraftingManager.java
|
|
|
|
+++ b/net/minecraft/server/CraftingManager.java
|
2017-05-16 13:22:07 +02:00
|
|
|
@@ -34,6 +34,7 @@
|
|
|
|
|
|
|
|
public static boolean init() {
|
|
|
|
try {
|
|
|
|
+ CraftingManager.c = 0; // Reset recipe ID count
|
|
|
|
a("armordye", new RecipeArmorDye());
|
|
|
|
a("bookcloning", new RecipeBookClone());
|
|
|
|
a("mapcloning", new RecipeMapClone());
|
|
|
|
@@ -147,6 +148,7 @@
|
|
|
|
if (CraftingManager.recipes.d(minecraftkey)) {
|
|
|
|
throw new IllegalStateException("Duplicate recipe ignored with ID " + minecraftkey);
|
|
|
|
} else {
|
2017-05-30 13:25:59 +02:00
|
|
|
+ irecipe.setKey(minecraftkey); // CraftBukkit
|
2017-05-16 13:22:07 +02:00
|
|
|
CraftingManager.recipes.a(CraftingManager.c++, minecraftkey, irecipe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -158,12 +160,14 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
do {
|
|
|
|
if (!iterator.hasNext()) {
|
|
|
|
+ inventorycrafting.currentRecipe = null; // CraftBukkit - Clear recipe when no recipe is found
|
2016-11-17 02:41:03 +01:00
|
|
|
return ItemStack.a;
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
irecipe = (IRecipe) iterator.next();
|
2015-02-26 23:41:06 +01:00
|
|
|
} while (!irecipe.a(inventorycrafting, world));
|
|
|
|
|
2017-05-14 04:00:00 +02:00
|
|
|
+ inventorycrafting.currentRecipe = irecipe; // CraftBukkit
|
|
|
|
return irecipe.craftItem(inventorycrafting);
|
|
|
|
}
|
|
|
|
|
2017-05-16 13:22:07 +02:00
|
|
|
@@ -175,12 +179,14 @@
|
2017-05-14 04:00:00 +02:00
|
|
|
|
|
|
|
do {
|
|
|
|
if (!iterator.hasNext()) {
|
|
|
|
+ inventorycrafting.currentRecipe = null; // CraftBukkit - Clear recipe when no recipe is found
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
irecipe = (IRecipe) iterator.next();
|
|
|
|
} while (!irecipe.a(inventorycrafting, world));
|
|
|
|
|
|
|
|
+ inventorycrafting.currentRecipe = irecipe; // CraftBukkit
|
|
|
|
return irecipe;
|
|
|
|
}
|
|
|
|
|
2017-05-16 13:22:07 +02:00
|
|
|
@@ -210,7 +216,7 @@
|
2017-05-14 04:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static int a(IRecipe irecipe) {
|
|
|
|
- return CraftingManager.recipes.a((Object) irecipe);
|
|
|
|
+ return CraftingManager.recipes.a(irecipe); // CraftBukkit - decompile error
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2017-05-14 04:00:00 +02:00
|
|
|
@Nullable
|