aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/util/Utils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/util/Utils.java')
-rw-r--r--src/main/java/de/cowtipper/cowlection/util/Utils.java12
1 files changed, 7 insertions, 5 deletions
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);
+ }
}
}
}