From 693064b0a2de4030971085004c080c4bb65c1fee Mon Sep 17 00:00:00 2001 From: Cow Date: Mon, 3 Oct 2022 22:16:51 +0200 Subject: Fixed `/bestiary` overview, closes #7 --- CHANGELOG.md | 2 ++ .../de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cce468a..45cdc45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fixed various API related issues caused by updates since the last release of Cowlection: - determining the active/selected profile - Minecraft username lookup by uuid changed since username history API got removed +- Fixed GUI related issues caused by updates since the last release of Cowlection: + - Fixed detection for `/bestiary` overview ## [1.8.9-0.14.0] - 14.08.2021 ### Added diff --git a/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java b/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java index 8f152a2..a75bc20 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java @@ -213,7 +213,7 @@ public class SkyBlockListener { // pet in pets menu for (int i = e.toolTip.size() - 1; i >= 0; i--) { String loreLine = EnumChatFormatting.getTextWithoutFormattingCodes(e.toolTip.get(i)); - if (loreLine.startsWith("--------------------")) { // exp bar to next level + if (loreLine.startsWith(" ")) { // exp bar to next level int beginPetExp = loreLine.indexOf(' '); int endPetExp = loreLine.indexOf('/'); if (beginPetExp < 0 || endPetExp < 0) { @@ -364,9 +364,9 @@ public class SkyBlockListener { for (int loreLineNr = 0; loreLineNr < loreList.tagCount(); ++loreLineNr) { String loreLineFormatted = loreList.getStringTagAt(loreLineNr); String loreLine = EnumChatFormatting.getTextWithoutFormattingCodes(loreLineFormatted); - if (loreLine.startsWith("-------------------- ")) { + if (loreLine.startsWith(" ")) { // bar to next level try { - String progress = loreLine.substring("-------------------- ".length()); + String progress = loreLine.substring(loreLine.lastIndexOf(' ') + 1); int divider = progress.indexOf('/'); if (divider > 0) { bestiaryOverview.add(new BestiaryEntry(TIER_SUFFIX_PATTERN.matcher(item.getDisplayName()).replaceFirst(""), -- cgit