2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
|
|
|
+++ b/net/minecraft/world/item/crafting/ShapelessRecipes.java
|
2024-06-14 01:05:00 +10:00
|
|
|
@@ -13,6 +13,13 @@
|
2021-03-16 09:00:00 +11:00
|
|
|
import net.minecraft.world.item.ItemStack;
|
|
|
|
import net.minecraft.world.level.World;
|
2021-03-09 08:47:33 +11:00
|
|
|
|
2014-11-26 08:32:16 +11:00
|
|
|
+// CraftBukkit start
|
2023-09-22 02:40:00 +10:00
|
|
|
+import org.bukkit.NamespacedKey;
|
2014-11-26 08:32:16 +11:00
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
2019-01-02 15:56:21 +11:00
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
2014-11-26 08:32:16 +11:00
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
|
|
|
|
+// CraftBukkit end
|
2021-03-09 08:47:33 +11:00
|
|
|
+
|
2019-04-23 12:00:00 +10:00
|
|
|
public class ShapelessRecipes implements RecipeCrafting {
|
2014-11-26 08:32:16 +11:00
|
|
|
|
2023-09-22 02:40:00 +10:00
|
|
|
final String group;
|
2024-06-14 01:05:00 +10:00
|
|
|
@@ -27,6 +34,22 @@
|
2017-05-14 12:00:00 +10:00
|
|
|
this.ingredients = nonnulllist;
|
2014-11-26 08:32:16 +11:00
|
|
|
}
|
2015-02-26 22:41:06 +00:00
|
|
|
|
2014-11-26 08:32:16 +11:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ @SuppressWarnings("unchecked")
|
2023-09-22 02:40:00 +10:00
|
|
|
+ @Override
|
|
|
|
+ public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe(NamespacedKey id) {
|
2014-11-26 08:32:16 +11:00
|
|
|
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
2023-09-22 02:40:00 +10:00
|
|
|
+ CraftShapelessRecipe recipe = new CraftShapelessRecipe(id, result, this);
|
2018-08-26 12:00:00 +10:00
|
|
|
+ recipe.setGroup(this.group);
|
2022-12-08 03:00:00 +11:00
|
|
|
+ recipe.setCategory(CraftRecipe.getCategory(this.category()));
|
2018-08-17 20:40:54 +10:00
|
|
|
+
|
2017-05-14 12:00:00 +10:00
|
|
|
+ for (RecipeItemStack list : this.ingredients) {
|
2019-01-02 15:56:21 +11:00
|
|
|
+ recipe.addIngredient(CraftRecipe.toBukkit(list));
|
2014-11-26 08:32:16 +11:00
|
|
|
+ }
|
|
|
|
+ return recipe;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2015-02-26 22:41:06 +00:00
|
|
|
+
|
2019-04-23 12:00:00 +10:00
|
|
|
@Override
|
2023-09-22 02:40:00 +10:00
|
|
|
public RecipeSerializer<?> getSerializer() {
|
|
|
|
return RecipeSerializer.SHAPELESS_RECIPE;
|