@@ -0,0 +1,112 @@
|
||||
--- a/net/minecraft/server/CraftingManager.java
|
||||
+++ b/net/minecraft/server/CraftingManager.java
|
||||
@@ -23,11 +23,13 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // CraftBukkit
|
||||
+
|
||||
public class CraftingManager extends ResourceDataJson {
|
||||
|
||||
private static final Gson a = (new GsonBuilder()).setPrettyPrinting().disableHtmlEscaping().create();
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
- public Map<Recipes<?>, Map<MinecraftKey, IRecipe<?>>> recipes = ImmutableMap.of();
|
||||
+ public Map<Recipes<?>, Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>>> recipes = ImmutableMap.of(); // CraftBukkit
|
||||
private boolean d;
|
||||
|
||||
public CraftingManager() {
|
||||
@@ -36,7 +38,12 @@
|
||||
|
||||
protected void a(Map<MinecraftKey, JsonElement> map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) {
|
||||
this.d = false;
|
||||
- Map<Recipes<?>, Builder<MinecraftKey, IRecipe<?>>> map1 = Maps.newHashMap();
|
||||
+ // CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable
|
||||
+ Map<Recipes<?>, Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>>> map1 = Maps.newHashMap();
|
||||
+ for (Recipes<?> recipeType : IRegistry.RECIPE_TYPE) {
|
||||
+ map1.put(recipeType, new Object2ObjectLinkedOpenHashMap<>());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
Iterator iterator = map.entrySet().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -46,24 +53,42 @@
|
||||
try {
|
||||
IRecipe<?> irecipe = a(minecraftkey, ChatDeserializer.m((JsonElement) entry.getValue(), "top element"));
|
||||
|
||||
- ((Builder) map1.computeIfAbsent(irecipe.g(), (recipes) -> {
|
||||
- return ImmutableMap.builder();
|
||||
- })).put(minecraftkey, irecipe);
|
||||
+ // CraftBukkit start - SPIGOT-4638: last recipe gets priority
|
||||
+ (map1.computeIfAbsent(irecipe.g(), (recipes) -> {
|
||||
+ return new Object2ObjectLinkedOpenHashMap<>();
|
||||
+ })).putAndMoveToFirst(minecraftkey, irecipe);
|
||||
+ // CraftBukkit end
|
||||
} catch (IllegalArgumentException | JsonParseException jsonparseexception) {
|
||||
CraftingManager.LOGGER.error("Parsing error loading recipe {}", minecraftkey, jsonparseexception);
|
||||
}
|
||||
}
|
||||
|
||||
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
||||
- return ((Builder) entry1.getValue()).build();
|
||||
+ return (entry1.getValue()); // CraftBukkit
|
||||
}));
|
||||
CraftingManager.LOGGER.info("Loaded {} recipes", map1.size());
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public void addRecipe(IRecipe<?> irecipe) {
|
||||
+ Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>> map = this.recipes.get(irecipe.g()); // CraftBukkit
|
||||
+
|
||||
+ if (map.containsKey(irecipe.getKey())) {
|
||||
+ throw new IllegalStateException("Duplicate recipe ignored with ID " + irecipe.getKey());
|
||||
+ } else {
|
||||
+ map.putAndMoveToFirst(irecipe.getKey(), irecipe); // CraftBukkit - SPIGOT-4638: last recipe gets priority
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public <C extends IInventory, T extends IRecipe<C>> Optional<T> craft(Recipes<T> recipes, C c0, World world) {
|
||||
- return this.b(recipes).values().stream().flatMap((irecipe) -> {
|
||||
+ // CraftBukkit start
|
||||
+ Optional<T> recipe = this.b(recipes).values().stream().flatMap((irecipe) -> {
|
||||
return SystemUtils.a(recipes.a(irecipe, world, c0));
|
||||
}).findFirst();
|
||||
+ c0.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
||||
+ // CraftBukkit end
|
||||
+ return recipe;
|
||||
}
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> List<T> a(Recipes<T> recipes) {
|
||||
@@ -81,7 +106,7 @@
|
||||
}
|
||||
|
||||
private <C extends IInventory, T extends IRecipe<C>> Map<MinecraftKey, IRecipe<C>> b(Recipes<T> recipes) {
|
||||
- return (Map) this.recipes.getOrDefault(recipes, Collections.emptyMap());
|
||||
+ return (Map) this.recipes.getOrDefault(recipes, new Object2ObjectLinkedOpenHashMap<>()); // CraftBukkit
|
||||
}
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> NonNullList<ItemStack> c(Recipes<T> recipes, C c0, World world) {
|
||||
@@ -102,7 +127,7 @@
|
||||
|
||||
public Optional<? extends IRecipe<?>> getRecipe(MinecraftKey minecraftkey) {
|
||||
return this.recipes.values().stream().map((map) -> {
|
||||
- return (IRecipe) map.get(minecraftkey);
|
||||
+ return map.get(minecraftkey); // CraftBukkit - decompile error
|
||||
}).filter(Objects::nonNull).findFirst();
|
||||
}
|
||||
|
||||
@@ -125,4 +150,14 @@
|
||||
return new JsonSyntaxException("Invalid or unsupported recipe type '" + s + "'");
|
||||
})).a(minecraftkey, jsonobject);
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ public void clearRecipes() {
|
||||
+ this.recipes = Maps.newHashMap();
|
||||
+
|
||||
+ for (Recipes<?> recipeType : IRegistry.RECIPE_TYPE) {
|
||||
+ this.recipes.put(recipeType, new Object2ObjectLinkedOpenHashMap<>());
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
--- a/net/minecraft/server/FurnaceRecipe.java
|
||||
+++ b/net/minecraft/server/FurnaceRecipe.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class FurnaceRecipe extends RecipeCooking {
|
||||
|
||||
public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,14 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.p;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+
|
||||
+ CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(CraftNamespacedKey.fromMinecraft(this.key), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
--- a/net/minecraft/server/IRecipe.java
|
||||
+++ b/net/minecraft/server/IRecipe.java
|
||||
@@ -35,4 +35,6 @@
|
||||
RecipeSerializer<?> getRecipeSerializer();
|
||||
|
||||
Recipes<?> g();
|
||||
+
|
||||
+ org.bukkit.inventory.Recipe toBukkitRecipe(); // CraftBukkit
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/net/minecraft/server/IRecipeComplex.java
|
||||
+++ b/net/minecraft/server/IRecipeComplex.java
|
||||
@@ -22,4 +22,11 @@
|
||||
public ItemStack getResult() {
|
||||
return ItemStack.b;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public org.bukkit.inventory.Recipe toBukkitRecipe() {
|
||||
+ return new org.bukkit.craftbukkit.inventory.CraftComplexRecipe(this);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
--- a/net/minecraft/server/RecipeBlasting.java
|
||||
+++ b/net/minecraft/server/RecipeBlasting.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftBlastingRecipe;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class RecipeBlasting extends RecipeCooking {
|
||||
|
||||
public RecipeBlasting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,16 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.q;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+
|
||||
+ CraftBlastingRecipe recipe = new CraftBlastingRecipe(CraftNamespacedKey.fromMinecraft(this.key), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
--- a/net/minecraft/server/RecipeCampfire.java
|
||||
+++ b/net/minecraft/server/RecipeCampfire.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftCampfireRecipe;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class RecipeCampfire extends RecipeCooking {
|
||||
|
||||
public RecipeCampfire(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,16 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.s;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+
|
||||
+ CraftCampfireRecipe recipe = new CraftCampfireRecipe(CraftNamespacedKey.fromMinecraft(this.key), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
--- a/net/minecraft/server/RecipeItemStack.java
|
||||
+++ b/net/minecraft/server/RecipeItemStack.java
|
||||
@@ -25,6 +25,7 @@
|
||||
private final RecipeItemStack.Provider[] b;
|
||||
public ItemStack[] choices;
|
||||
private IntList d;
|
||||
+ public boolean exact; // CraftBukkit
|
||||
|
||||
public RecipeItemStack(Stream<? extends RecipeItemStack.Provider> stream) {
|
||||
this.b = (RecipeItemStack.Provider[]) stream.toArray((i) -> {
|
||||
@@ -57,6 +58,15 @@
|
||||
for (int j = 0; j < i; ++j) {
|
||||
ItemStack itemstack1 = aitemstack[j];
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ if (exact) {
|
||||
+ if (itemstack1.getItem() == itemstack.getItem() && ItemStack.equals(itemstack, itemstack1)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ continue;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (itemstack1.getItem() == itemstack.getItem()) {
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
--- a/net/minecraft/server/RecipeSmithing.java
|
||||
+++ b/net/minecraft/server/RecipeSmithing.java
|
||||
@@ -3,6 +3,14 @@
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftSmithingRecipe;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class RecipeSmithing implements IRecipe<IInventory> {
|
||||
|
||||
private final RecipeItemStack a;
|
||||
@@ -58,6 +66,17 @@
|
||||
return Recipes.SMITHING;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.c);
|
||||
+
|
||||
+ CraftSmithingRecipe recipe = new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.d), result, CraftRecipe.toBukkit(this.a), CraftRecipe.toBukkit(this.b));
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public static class a implements RecipeSerializer<RecipeSmithing> {
|
||||
|
||||
public a() {}
|
||||
@@ -0,0 +1,33 @@
|
||||
--- a/net/minecraft/server/RecipeSmoking.java
|
||||
+++ b/net/minecraft/server/RecipeSmoking.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftSmokingRecipe;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class RecipeSmoking extends RecipeCooking {
|
||||
|
||||
public RecipeSmoking(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
|
||||
@@ -10,4 +18,16 @@
|
||||
public RecipeSerializer<?> getRecipeSerializer() {
|
||||
return RecipeSerializer.r;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+
|
||||
+ CraftSmokingRecipe recipe = new CraftSmokingRecipe(CraftNamespacedKey.fromMinecraft(this.key), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
+ recipe.setGroup(this.group);
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
--- a/net/minecraft/server/RecipeStonecutting.java
|
||||
+++ b/net/minecraft/server/RecipeStonecutting.java
|
||||
@@ -1,5 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftStonecuttingRecipe;
|
||||
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
+import org.bukkit.inventory.Recipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class RecipeStonecutting extends RecipeSingleItem {
|
||||
|
||||
public RecipeStonecutting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack) {
|
||||
@@ -10,4 +18,16 @@
|
||||
public boolean a(IInventory iinventory, World world) {
|
||||
return this.ingredient.test(iinventory.getItem(0));
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public Recipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+
|
||||
+ CraftStonecuttingRecipe recipe = new CraftStonecuttingRecipe(CraftNamespacedKey.fromMinecraft(this.key), result, CraftRecipe.toBukkit(this.ingredient));
|
||||
+ recipe.setGroup(this.group);
|
||||
+
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
--- a/net/minecraft/server/ShapedRecipes.java
|
||||
+++ b/net/minecraft/server/ShapedRecipes.java
|
||||
@@ -13,6 +13,13 @@
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftShapedRecipe;
|
||||
+import org.bukkit.inventory.RecipeChoice;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class ShapedRecipes implements RecipeCrafting {
|
||||
|
||||
private final int width;
|
||||
@@ -31,6 +38,66 @@
|
||||
this.result = itemstack;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public org.bukkit.inventory.ShapedRecipe toBukkitRecipe() {
|
||||
+ CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
+ CraftShapedRecipe recipe = new CraftShapedRecipe(result, this);
|
||||
+ recipe.setGroup(this.group);
|
||||
+
|
||||
+ switch (this.height) {
|
||||
+ case 1:
|
||||
+ switch (this.width) {
|
||||
+ case 1:
|
||||
+ recipe.shape("a");
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ recipe.shape("ab");
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ recipe.shape("abc");
|
||||
+ break;
|
||||
+ }
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ switch (this.width) {
|
||||
+ case 1:
|
||||
+ recipe.shape("a","b");
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ recipe.shape("ab","cd");
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ recipe.shape("abc","def");
|
||||
+ break;
|
||||
+ }
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ switch (this.width) {
|
||||
+ case 1:
|
||||
+ recipe.shape("a","b","c");
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ recipe.shape("ab","cd","ef");
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ recipe.shape("abc","def","ghi");
|
||||
+ break;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ char c = 'a';
|
||||
+ for (RecipeItemStack list : this.items) {
|
||||
+ RecipeChoice choice = CraftRecipe.toBukkit(list);
|
||||
+ if (choice != null) {
|
||||
+ recipe.setIngredient(c, choice);
|
||||
+ }
|
||||
+
|
||||
+ c++;
|
||||
+ }
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
@Override
|
||||
public MinecraftKey getKey() {
|
||||
return this.key;
|
||||
@@ -0,0 +1,36 @@
|
||||
--- a/net/minecraft/server/ShapelessRecipes.java
|
||||
+++ b/net/minecraft/server/ShapelessRecipes.java
|
||||
@@ -6,6 +6,12 @@
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import java.util.Iterator;
|
||||
|
||||
+// 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 key;
|
||||
@@ -20,6 +26,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.key;
|
||||
Reference in New Issue
Block a user