aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2021-08-02 17:56:51 +0200
committerCow <cow@volloeko.de>2021-08-02 17:56:51 +0200
commit93576728a754b36b7f139d6c45bcbf2ec203d441 (patch)
treedc4ed9f62367ff97e23434178d5db60be1238561
parent3d0c09bbd403de89f6e568ebdf02163bc4f573a6 (diff)
downloadCowlection-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.md1
-rw-r--r--src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java2
-rw-r--r--src/main/java/de/cowtipper/cowlection/util/Utils.java12
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);
+ }
}
}
}