[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 <t00thpick1dirko@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2013-12-20 18:44:13 -05:00
parent 815904c481
commit fda1280bce
2 changed files with 3 additions and 1 deletions

View file

@ -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() {

View file

@ -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));
}
}