mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
eed041d629
By: md_5 <git@md-5.net>
39 lines
1.3 KiB
Diff
39 lines
1.3 KiB
Diff
--- a/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
|
+++ b/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
|
@@ -13,6 +13,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;
|
|
@@ -27,6 +34,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;
|