From 803268867ebdabf9d1ed69c0a487899821a3cefc Mon Sep 17 00:00:00 2001 From: toastedtruth Date: Sun, 1 Dec 2013 23:19:14 +0000 Subject: [PATCH] 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. --- src/main/java/net/minecraft/server/RecipeBookClone.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/RecipeBookClone.java b/src/main/java/net/minecraft/server/RecipeBookClone.java index 473ed4e61b..8182a5fd8f 100644 --- a/src/main/java/net/minecraft/server/RecipeBookClone.java +++ b/src/main/java/net/minecraft/server/RecipeBookClone.java @@ -1,6 +1,12 @@ 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) { int i = 0;