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 /src | |
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
Diffstat (limited to 'src')
-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 |
2 files changed, 8 insertions, 6 deletions
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); + } } } } |