SPIGOT-7924: Registering a ShapelessRecipe throws an IndexOutOfBoundsException
This commit is contained in:
parent
270be4863b
commit
7b5b63b222
@ -41,8 +41,8 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe
|
|||||||
public void addToCraftingManager() {
|
public void addToCraftingManager() {
|
||||||
List<org.bukkit.inventory.RecipeChoice> ingred = this.getChoiceList();
|
List<org.bukkit.inventory.RecipeChoice> ingred = this.getChoiceList();
|
||||||
List<RecipeItemStack> data = new ArrayList<>(ingred.size());
|
List<RecipeItemStack> data = new ArrayList<>(ingred.size());
|
||||||
for (int i = 0; i < ingred.size(); i++) {
|
for (org.bukkit.inventory.RecipeChoice i : ingred) {
|
||||||
data.set(i, toNMS(ingred.get(i), true));
|
data.add(toNMS(i, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftRecipe.toMinecraft(this.getKey()), new ShapelessRecipes(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data)));
|
MinecraftServer.getServer().getRecipeManager().addRecipe(new RecipeHolder<>(CraftRecipe.toMinecraft(this.getKey()), new ShapelessRecipes(this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user