mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
b3a8254758
By: md_5 <git@md-5.net>
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
--- a/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
|
+++ b/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
|
@@ -14,6 +14,12 @@
|
|
import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.level.World;
|
|
|
|
+// CraftBukkit start
|
|
+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 {
|
|
|
|
private final MinecraftKey id;
|
|
@@ -28,6 +34,20 @@
|
|
this.ingredients = nonnulllist;
|
|
}
|
|
|
|
+ // CraftBukkit start
|
|
+ @SuppressWarnings("unchecked")
|
|
+ public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe() {
|
|
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
|
+ CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, this);
|
|
+ recipe.setGroup(this.group);
|
|
+
|
|
+ for (RecipeItemStack list : this.ingredients) {
|
|
+ recipe.addIngredient(CraftRecipe.toBukkit(list));
|
|
+ }
|
|
+ return recipe;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
@Override
|
|
public MinecraftKey getKey() {
|
|
return this.id;
|