2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/RecipeRepair.java
|
|
|
|
+++ b/net/minecraft/server/RecipeRepair.java
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -3,9 +3,13 @@
|
|
|
|
import com.google.common.collect.Lists;
|
2014-11-25 22:32:16 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2017-05-14 04:00:00 +02:00
|
|
|
-public class RecipeRepair extends IRecipe {
|
|
|
|
+public class RecipeRepair extends ShapelessRecipes { // CraftBukkit
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
- public RecipeRepair() {}
|
|
|
|
+ // CraftBukkit start - Delegate to new parent class
|
|
|
|
+ public RecipeRepair() {
|
2017-05-14 04:00:00 +02:00
|
|
|
+ super("", new ItemStack(Items.LEATHER_HELMET), NonNullList.a(RecipeItemStack.a, RecipeItemStack.a(Items.LEATHER_HELMET)));
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
|
|
|
|
public boolean a(InventoryCrafting inventorycrafting, World world) {
|
|
|
|
ArrayList arraylist = Lists.newArrayList();
|
2017-05-14 04:00:00 +02:00
|
|
|
@@ -62,7 +66,18 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
i1 = 0;
|
|
|
|
}
|
2015-02-26 23:41:06 +01:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
- return new ItemStack(itemstack2.getItem(), 1, i1);
|
|
|
|
+ // CraftBukkit start - Construct a dummy repair recipe
|
|
|
|
+ ItemStack result = new ItemStack(itemstack.getItem(), 1, i1);
|
2017-05-14 04:00:00 +02:00
|
|
|
+ NonNullList<RecipeItemStack> ingredients = NonNullList.a();
|
|
|
|
+ ingredients.add(new RecipeItemStack(itemstack2.cloneItemStack()));
|
|
|
|
+ ingredients.add(new RecipeItemStack(itemstack.cloneItemStack()));
|
|
|
|
+ ShapelessRecipes recipe = new ShapelessRecipes(this.a, result.cloneItemStack(), ingredients);
|
|
|
|
+ recipe.key = new MinecraftKey("repairitem");
|
2014-11-25 22:32:16 +01:00
|
|
|
+ inventorycrafting.currentRecipe = recipe;
|
2017-05-14 04:00:00 +02:00
|
|
|
+ result = org.bukkit.craftbukkit.event.CraftEventFactory.callPreCraftEvent(inventorycrafting, result, inventorycrafting.container.getBukkitView(), true);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ return result;
|
|
|
|
+ // return new ItemStack(itemstack2.getItem(), 1, i1);
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|