From fda1280bce9d06eb9d0ff8c315df61f17a6cae6a Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 20 Dec 2013 18:44:13 -0500 Subject: [PATCH] [Bleeding] Handle custom furnace recipes separately. Fixes BUKKIT-1657, BUKKIT-3846 Due to vanilla blanket comparing data values, and the unspecified order of hashmap iterators, we need to run through custom recipes first, and therefore separately, to ensure that they are actually used. By not adding the custom results to the experience table, we do not override the experience gains from vanilla smelting recipes. By: t00thpick1 --- .../src/main/java/org/bukkit/craftbukkit/CraftServer.java | 2 ++ .../org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 362b507b9d..2653710313 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -961,11 +961,13 @@ public final class CraftServer implements Server { public void clearRecipes() { CraftingManager.getInstance().recipes.clear(); RecipesFurnace.getInstance().recipes.clear(); + RecipesFurnace.getInstance().customRecipes.clear(); } public void resetRecipes() { CraftingManager.getInstance().recipes = new CraftingManager().recipes; RecipesFurnace.getInstance().recipes = new RecipesFurnace().recipes; + RecipesFurnace.getInstance().customRecipes.clear(); } public Map getCommandAliases() { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java index 49b2cbaf7a..69f17db842 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java @@ -22,6 +22,6 @@ public class CraftFurnaceRecipe extends FurnaceRecipe implements CraftRecipe { public void addToCraftingManager() { ItemStack result = this.getResult(); ItemStack input = this.getInput(); - RecipesFurnace.getInstance().a(CraftMagicNumbers.getItem(input.getTypeId()), CraftItemStack.asNMSCopy(result), 0.1f); + RecipesFurnace.getInstance().registerRecipe(CraftItemStack.asNMSCopy(input), CraftItemStack.asNMSCopy(result)); } }