aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/skyblock/garden
diff options
context:
space:
mode:
authorRime <81419447+Emirlol@users.noreply.github.com>2024-05-11 14:08:59 +0300
committerRime <81419447+Emirlol@users.noreply.github.com>2024-05-23 13:31:48 +0300
commite2f18c84ce2de2da228ff88b6b67fa5d46945255 (patch)
tree02625a4bbf8ebb72a19f9f98d43f68603f1ce4e6 /src/main/java/de/hysky/skyblocker/skyblock/garden
parent05a18be31a137148bcd446654c550eb2d713990c (diff)
downloadSkyblocker-e2f18c84ce2de2da228ff88b6b67fa5d46945255.tar.gz
Skyblocker-e2f18c84ce2de2da228ff88b6b67fa5d46945255.tar.bz2
Skyblocker-e2f18c84ce2de2da228ff88b6b67fa5d46945255.zip
Add support for unemployed rabbits
- Refactored ItemUtils.getHeadTexture to use the property iterator instead of streams and return Optional<String> rather than empty string to make the results clear and easier to work with. - Refactored regex matching logic in ChocolateFactorySolver.getCPSIncreaseFactor to a separate function
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/garden')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java b/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
index 682933f4..0f349a4f 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/garden/VisitorHelper.java
@@ -94,9 +94,7 @@ public class VisitorHelper {
}
private static @Nullable String getTextureOrNull(ItemStack stack) {
- String texture = ItemUtils.getHeadTexture(stack);
-
- return texture.isEmpty() ? null : texture;
+ return ItemUtils.getHeadTexture(stack).orElse(null);
}
private static void processLore(String visitorName, @Nullable String visitorTexture, List<Text> loreList) {