From fff992ae9f09bc086fb128327790266f5f917446 Mon Sep 17 00:00:00 2001 From: Rime <81419447+Emirlol@users.noreply.github.com> Date: Wed, 15 May 2024 01:23:56 +0300 Subject: Update src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/ChocolateFactorySolver.java Co-authored-by: Julienraptor01 --- .../skyblock/chocolatefactory/ChocolateFactorySolver.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/ChocolateFactorySolver.java b/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/ChocolateFactorySolver.java index 7c4bbbd6..bceee649 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/ChocolateFactorySolver.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/chocolatefactory/ChocolateFactorySolver.java @@ -56,13 +56,13 @@ public class ChocolateFactorySolver extends ContainerSolver { .collect(Collectors.toCollection(LinkedList::new)); Int2ObjectMap.Entry bestEntry = sorted.removeFirst(); - if (totalChocolate.isEmpty() || bestEntry.getValue().cost < totalChocolate.getAsLong()) return List.of(ColorHighlight.green(bestEntry.getIntKey())); + if (totalChocolate.isEmpty()) return List.of(ColorHighlight.yellow(bestEntry.getIntKey())); - for (Int2ObjectMap.Entry entry : sorted) { - if (entry.getValue().cost > totalChocolate.getAsLong()) continue; - return List.of(ColorHighlight.green(entry.getIntKey()), ColorHighlight.yellow(bestEntry.getIntKey())); - } - return List.of(ColorHighlight.green(bestEntry.getIntKey())); + if (bestEntry.getValue().cost <= totalChocolate.getAsLong()) return List.of(ColorHighlight.green(bestEntry.getIntKey())); + + for (Int2ObjectMap.Entry entry : sorted) if (entry.getValue().cost <= totalChocolate.getAsLong()) return List.of(ColorHighlight.green(entry.getIntKey()), ColorHighlight.yellow(bestEntry.getIntKey())); + + return List.of(ColorHighlight.yellow(bestEntry.getIntKey())); } /** -- cgit