Crafting fixes and recipe iterator

Discussion in 'Bukkit Preview' started by Celtic Minstrel, Feb 24, 2012.

  1. Offline

    Celtic Minstrel

    At last there is a way to fetch and remove recipes! If you want to find a list of recipes that produce a given output, you can do so with Bukkit.getRecipesFor(itemStack). If you want to find and possibly remove a specific recipe, you'll have to use the iterator. To do this, use Bukkit.recipeIterator() and then use the result like a normal iterator.

    In addition, the Recipe classes have been fixed so that they can store data values larger than 127 for the input. This means you can now make recipes that take potions as input and have them work on potions brewed from a brewing stand (most of which have data values over 8192). The reason for this issue existing in the first place is that MaterialData, which all the methods used, cannot store data over 127. These methods still exist, so if you want to use potions make sure to use a different method.

    If you used FurnaceRecipe.getInput(), ShapedRecipe.getIngredientMap(), or ShapelessRecipe.getIngredientList(), you'll need to recompile your plugin since their return type has changed.

    And last but not least, you can clear the entire recipe list or reset it to default with a single function call.
     
    dadaemon and mushroomhostage like this.

Share This Page