diff options
author | Cow <cow@volloeko.de> | 2022-10-03 22:16:51 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2022-10-03 22:16:51 +0200 |
commit | 693064b0a2de4030971085004c080c4bb65c1fee (patch) | |
tree | f34b87e4f26934711f8d4e4981d7cb47bf22c630 | |
parent | 8184833d01e3db0d2e386bc449e965f0f05b2a1b (diff) | |
download | Cowlection-693064b0a2de4030971085004c080c4bb65c1fee.tar.gz Cowlection-693064b0a2de4030971085004c080c4bb65c1fee.tar.bz2 Cowlection-693064b0a2de4030971085004c080c4bb65c1fee.zip |
Fixed `/bestiary` overview, closes #7
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/main/java/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(""), |