mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 19:28:03 +01:00
SPIGOT-7922: ExactChoice recipe fails to be added
By: md_5 <git@md-5.net>
This commit is contained in:
parent
cd2a2a27ff
commit
adbb925fc4
2 changed files with 4 additions and 4 deletions
|
@ -16,9 +16,9 @@
|
|||
+ return this.itemStacks;
|
||||
+ }
|
||||
+
|
||||
+ public static RecipeItemStack ofStacks(Stream<ItemStack> stacks) {
|
||||
+ RecipeItemStack recipe = RecipeItemStack.of(stacks.map(ItemStack::getItem));
|
||||
+ recipe.itemStacks = stacks.toList();
|
||||
+ public static RecipeItemStack ofStacks(List<ItemStack> stacks) {
|
||||
+ RecipeItemStack recipe = RecipeItemStack.of(stacks.stream().map(ItemStack::getItem));
|
||||
+ recipe.itemStacks = stacks;
|
||||
+ return recipe;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
|
|
@ -33,7 +33,7 @@ public interface CraftRecipe extends Recipe {
|
|||
} else if (bukkit instanceof RecipeChoice.MaterialChoice) {
|
||||
stack = RecipeItemStack.of(((RecipeChoice.MaterialChoice) bukkit).getChoices().stream().map((mat) -> CraftItemType.bukkitToMinecraft(mat)));
|
||||
} else if (bukkit instanceof RecipeChoice.ExactChoice) {
|
||||
stack = RecipeItemStack.ofStacks(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map((mat) -> CraftItemStack.asNMSCopy(mat)));
|
||||
stack = RecipeItemStack.ofStacks(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map((mat) -> CraftItemStack.asNMSCopy(mat)).toList());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown recipe stack instance " + bukkit);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue