PaperMC/patches/api/Move-CraftComplexRecipe-to-extend-CraftingRecipe.patch

27 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bjarne Koll <git@lynxplay.dev>
Date: Fri, 19 Jul 2024 19:09:21 +0200
Subject: [PATCH] Move CraftComplexRecipe to extend CraftingRecipe
A craft complex recipe wraps a CustomRecipe, which itself is a
CraftingRecipe.
As such, this complex recipe should also be a crafting recipe.
diff --git a/src/main/java/org/bukkit/inventory/CraftingRecipe.java b/src/main/java/org/bukkit/inventory/CraftingRecipe.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/CraftingRecipe.java
+++ b/src/main/java/org/bukkit/inventory/CraftingRecipe.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
* Represents a shaped or shapeless crafting recipe.
*/
public abstract class CraftingRecipe implements Recipe, Keyed {
- private final NamespacedKey key;
- private final ItemStack output;
+ // Paper - make CraftComplexRecipe extend CraftingRecipe - start
+ protected NamespacedKey key;
+ protected ItemStack output;
+ protected CraftingRecipe() {}
+ // Paper - make CraftComplexRecipe extend CraftingRecipe - end
private String group = "";
private CraftingBookCategory category = CraftingBookCategory.MISC;