diff options
author | t00thpick1 <t00thpick1dirko@gmail.com> | 2013-12-20 18:44:13 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-12-20 23:37:58 -0600 |
commit | 1ecc59d4d915938f6ed8e59e87a43ede50715410 (patch) | |
tree | 150678f03d1af1464ff8087ffdc245333d6a9991 /src/main/java/org | |
parent | 3c209a9884389184134c6c3bb31d5ab8c8842831 (diff) | |
download | craftbukkit-1ecc59d4d915938f6ed8e59e87a43ede50715410.tar craftbukkit-1ecc59d4d915938f6ed8e59e87a43ede50715410.tar.gz craftbukkit-1ecc59d4d915938f6ed8e59e87a43ede50715410.tar.lz craftbukkit-1ecc59d4d915938f6ed8e59e87a43ede50715410.tar.xz craftbukkit-1ecc59d4d915938f6ed8e59e87a43ede50715410.zip |
[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.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 362b507b..26537103 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/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<String, String[]> getCommandAliases() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java index 49b2cbaf..69f17db8 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftFurnaceRecipe.java +++ b/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)); } } |