diff options
author | Cow <cow@volloeko.de> | 2021-08-02 17:56:51 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2021-08-02 17:56:51 +0200 |
commit | 93576728a754b36b7f139d6c45bcbf2ec203d441 (patch) | |
tree | dc4ed9f62367ff97e23434178d5db60be1238561 | |
parent | 3d0c09bbd403de89f6e568ebdf02163bc4f573a6 (diff) | |
download | Cowlection-93576728a754b36b7f139d6c45bcbf2ec203d441.tar.gz Cowlection-93576728a754b36b7f139d6c45bcbf2ec203d441.tar.bz2 Cowlection-93576728a754b36b7f139d6c45bcbf2ec203d441.zip |
Disabled dungeon tooltip cleaner inside dungeons
- Also fixed a rare crash caused by missing reforges in item names
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java | 2 | ||||
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/util/Utils.java | 12 |
3 files changed, 9 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index eba8214..bbffd42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `/moo config` sub-category explanations now default to "tooltip *without* darkened background", as the darkened background was more irritating than helpful - MC Log file search now skips large files to prevent huge log files from blocking the search - Dungeon Party Finder: Each dungeon class can now also be blocked or blocked if duplicated (= red party background) +- Disabled dungeon tooltip cleaner inside dungeons (+ fixed a rare crash) ### Fixed - 'Show Dungeon item base stats' feature now works with HPB'd items and master stars diff --git a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java index 57afdb1..b70dc25 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java @@ -123,7 +123,7 @@ public class DungeonsListener { if (e.itemStack == null || e.toolTip == null) { return; } - boolean toggleKeyBindingPressed = MooConfig.isDungeonItemTooltipToggleKeyBindingPressed(); + boolean toggleKeyBindingPressed = MooConfig.isDungeonItemTooltipToggleKeyBindingPressed() && !main.getDungeonCache().isInDungeon(); MooConfig.Setting showItemQualityAndFloorDisplay = MooConfig.getShowItemQualityAndFloorDisplay(); boolean showItemQualityAndFloor = showItemQualityAndFloorDisplay == MooConfig.Setting.ALWAYS || (showItemQualityAndFloorDisplay == MooConfig.Setting.SPECIAL && toggleKeyBindingPressed); diff --git a/src/main/java/de/cowtipper/cowlection/util/Utils.java b/src/main/java/de/cowtipper/cowlection/util/Utils.java index 9a07ab8..0d2290d 100644 --- a/src/main/java/de/cowtipper/cowlection/util/Utils.java +++ b/src/main/java/de/cowtipper/cowlection/util/Utils.java @@ -376,11 +376,13 @@ public final class Utils { reforgeLength = reforgePrefix.length() - 1; } - if (strikethrough) { - modifiedItemName.insert(reforgeInItemName, grayedOutFormatting) - .insert(reforgeInItemName + reforgeLength + grayedOutFormatting.length(), originalItemName.substring(0, reforgeInItemName)); - } else { - modifiedItemName.delete(reforgeInItemName, reforgeInItemName + reforgeLength); + if(reforgeInItemName >= 0) { + if (strikethrough) { + modifiedItemName.insert(reforgeInItemName, grayedOutFormatting) + .insert(reforgeInItemName + reforgeLength + grayedOutFormatting.length(), originalItemName.substring(0, reforgeInItemName)); + } else { + modifiedItemName.delete(reforgeInItemName, reforgeInItemName + reforgeLength); + } } } } |