mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Add predicate to recipe's ExactChoice ingredient
This commit is contained in:
committed by
granny
parent
97d90df5da
commit
32db32c5ae
@@ -0,0 +1,10 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
|
||||
@@ -36,6 +_,7 @@
|
||||
stack = Ingredient.of(((RecipeChoice.MaterialChoice) bukkit).getChoices().stream().map((mat) -> CraftItemType.bukkitToMinecraft(mat)));
|
||||
} else if (bukkit instanceof RecipeChoice.ExactChoice) {
|
||||
stack = Ingredient.ofStacks(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map((mat) -> CraftItemStack.asNMSCopy(mat)).toList());
|
||||
+ stack.predicate = ((RecipeChoice.ExactChoice) bukkit).getPredicate(); // Purpur - Add predicate to recipe's ExactChoice ingredient
|
||||
// Paper start - support "empty" choices - legacy method that spigot might incorrectly call
|
||||
// Their impl of Ingredient.of() will error, ingredients need at least one entry.
|
||||
// Callers running into this exception may have passed an incorrect empty() recipe choice to a non-empty slot or
|
||||
Reference in New Issue
Block a user