Fix written books crashing the server. Fixes BUKKIT-4945

CraftBukkit modifies the IRecipe interface, adding new methods, so all
classes that implement IRecipe need to be imported and modified to add the
new methods.

Extending ShapelessRecipes implements the added methods and allows
RecipeBookClone to work with the Recipes API in a way that is consistent
with similar recipes, even if the recipe information present in the API
isn't technically correct.
This commit is contained in:
toastedtruth 2013-12-01 23:19:14 +00:00 committed by Nate Mortensen
parent 579b203347
commit 803268867e

View file

@ -1,6 +1,12 @@
package net.minecraft.server; package net.minecraft.server;
public class RecipeBookClone implements IRecipe { public class RecipeBookClone extends ShapelessRecipes implements IRecipe { // CraftBukkit - added extends
// CraftBukkit start - Delegate to new parent class
public RecipeBookClone() {
super(new ItemStack(Items.WRITTEN_BOOK, 0, -1), java.util.Arrays.asList(new ItemStack(Items.BOOK_AND_QUILL, 0, 0)));
}
// CraftBukkit end
public boolean a(InventoryCrafting inventoryCrafting, World paramWorld) { public boolean a(InventoryCrafting inventoryCrafting, World paramWorld) {
int i = 0; int i = 0;