mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:00:02 +03:00
45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/crafting/ShapelessRecipes.java
|
|
@@ -1,12 +1,18 @@
|
|
package net.minecraft.item.crafting;
|
|
|
|
import com.google.common.collect.Lists;
|
|
-import java.util.List;
|
|
-import javax.annotation.Nullable;
|
|
import net.minecraft.inventory.InventoryCrafting;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.world.World;
|
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
|
+import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
|
|
|
|
+import javax.annotation.Nullable;
|
|
+import java.util.List;
|
|
+
|
|
+//CraftBukkit start
|
|
+// CraftBukkit end
|
|
+
|
|
public class ShapelessRecipes implements IRecipe
|
|
{
|
|
private final ItemStack recipeOutput;
|
|
@@ -17,7 +23,19 @@
|
|
this.recipeOutput = output;
|
|
this.recipeItems = inputList;
|
|
}
|
|
-
|
|
+ // CraftBukkit start
|
|
+ @SuppressWarnings("unchecked")
|
|
+ public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe() {
|
|
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.recipeOutput);
|
|
+ CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, this);
|
|
+ for (ItemStack stack : (List<ItemStack>) this.recipeItems) {
|
|
+ if (stack != null) {
|
|
+ recipe.addIngredient(org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(stack.getItem()), stack.getMetadata());
|
|
+ }
|
|
+ }
|
|
+ return recipe;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
@Nullable
|
|
public ItemStack getRecipeOutput()
|
|
{
|