From 3d5aadd1d8f1812600d796db6198cb53b85d53a6 Mon Sep 17 00:00:00 2001 From: Zoinkwiz Date: Thu, 21 Nov 2024 22:56:52 +0000 Subject: [PATCH] fix: Add checkItems to ItemRequirements --- .../questhelper/requirements/item/ItemRequirements.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/questhelper/requirements/item/ItemRequirements.java b/src/main/java/com/questhelper/requirements/item/ItemRequirements.java index cf672431bc..59234965d5 100644 --- a/src/main/java/com/questhelper/requirements/item/ItemRequirements.java +++ b/src/main/java/com/questhelper/requirements/item/ItemRequirements.java @@ -123,6 +123,14 @@ public Color getColor(Client client, QuestHelperConfig config) return this.check(client) ? config.passColour() : config.failColour(); } + @Override + public boolean checkItems(Client client, List items) + { + Predicate predicate = r -> r.checkItems(client, items); + int successes = (int) itemRequirements.stream().filter(Objects::nonNull).filter(predicate).count(); + return logicType.compare(successes, itemRequirements.size()); + } + @Override public Color getColorConsideringBank(Client client, QuestHelperConfig config) {