Skip to content

Commit 96a4c55

Browse files
committed
Add CustomItemRecipeChoice
1 parent c8d56c4 commit 96a4c55

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.github.kiber2009.plugin.contentapi.api.recipe.choice;
2+
3+
import io.github.kiber2009.plugin.contentapi.api.item.CustomItem;
4+
import org.bukkit.inventory.ItemStack;
5+
import org.jetbrains.annotations.Contract;
6+
import org.jspecify.annotations.NonNull;
7+
import org.jspecify.annotations.Nullable;
8+
9+
import java.util.function.Predicate;
10+
11+
public class CustomItemRecipeChoice implements Predicate<@Nullable ItemStack> {
12+
private final CustomItem item;
13+
14+
public CustomItemRecipeChoice(final @NonNull CustomItem item) {
15+
this.item = item;
16+
}
17+
18+
@Override
19+
@Contract(value = "null -> false", pure = true)
20+
public boolean test(final @Nullable ItemStack stack) {
21+
return item.match(stack);
22+
}
23+
}

0 commit comments

Comments
 (0)