aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/item/crafting/ShapelessRecipes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/item/crafting/ShapelessRecipes.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/item/crafting/ShapelessRecipes.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/item/crafting/ShapelessRecipes.patch b/patch-remap/og/net/minecraft/world/item/crafting/ShapelessRecipes.patch
new file mode 100644
index 0000000000..d9fc255ffe
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/item/crafting/ShapelessRecipes.patch
@@ -0,0 +1,39 @@
+--- a/net/minecraft/world/item/crafting/ShapelessRecipes.java
++++ b/net/minecraft/world/item/crafting/ShapelessRecipes.java
+@@ -14,6 +14,13 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.World;
+
++// CraftBukkit start
++import org.bukkit.NamespacedKey;
++import org.bukkit.craftbukkit.inventory.CraftItemStack;
++import org.bukkit.craftbukkit.inventory.CraftRecipe;
++import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
++// CraftBukkit end
++
+ public class ShapelessRecipes implements RecipeCrafting {
+
+ final String group;
+@@ -28,6 +35,22 @@
+ this.ingredients = nonnulllist;
+ }
+
++ // CraftBukkit start
++ @SuppressWarnings("unchecked")
++ @Override
++ public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe(NamespacedKey id) {
++ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
++ CraftShapelessRecipe recipe = new CraftShapelessRecipe(id, result, this);
++ recipe.setGroup(this.group);
++ recipe.setCategory(CraftRecipe.getCategory(this.category()));
++
++ for (RecipeItemStack list : this.ingredients) {
++ recipe.addIngredient(CraftRecipe.toBukkit(list));
++ }
++ return recipe;
++ }
++ // CraftBukkit end
++
+ @Override
+ public RecipeSerializer<?> getSerializer() {
+ return RecipeSerializer.SHAPELESS_RECIPE;