aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-07-26 15:25:03 +0200
committerCow <cow@volloeko.de>2020-07-26 15:25:03 +0200
commitb9c5f23a671c50422303bf50e315d364b1354acf (patch)
tree07ed5e82a1a9465421bb2c92e2926d2407b5a681 /src
parentb7526fccd188bc55e87d86d3d685a932756b7d70 (diff)
downloadCowlection-b9c5f23a671c50422303bf50e315d364b1354acf.tar.gz
Cowlection-b9c5f23a671c50422303bf50e315d364b1354acf.tar.bz2
Cowlection-b9c5f23a671c50422303bf50e315d364b1354acf.zip
Small fixes
- Remove ": " when copying chat messages - Fix dungeon tooltip cleaner cleaning a little bit too much - Temporary work-around to fix crash with other mods not being able to handle offline messages
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/olli/cowlection/listener/ChatListener.java3
-rw-r--r--src/main/java/eu/olli/cowlection/listener/skyblock/DungeonsListener.java6
-rw-r--r--src/main/java/eu/olli/cowlection/util/VersionChecker.java8
3 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/eu/olli/cowlection/listener/ChatListener.java b/src/main/java/eu/olli/cowlection/listener/ChatListener.java
index 6fbc179..42c6f84 100644
--- a/src/main/java/eu/olli/cowlection/listener/ChatListener.java
+++ b/src/main/java/eu/olli/cowlection/listener/ChatListener.java
@@ -107,6 +107,9 @@ public class ChatListener {
chatData = main.getChatHelper().cleanChatComponent(chatComponent);
} else {
chatData = StringUtils.stripControlCodes(chatComponent.getUnformattedText());
+ if (chatData.startsWith(": ")) {
+ chatData = chatData.substring(2);
+ }
}
GuiControls.setClipboardString(chatData);
main.getChatHelper().sendAboveChatMessage(EnumChatFormatting.YELLOW + "Copied chat component to clipboard:", "" + EnumChatFormatting.BOLD + EnumChatFormatting.GOLD + "\u276E" + EnumChatFormatting.RESET + (copyWithFormatting ? chatComponent.getUnformattedText() : chatData) + EnumChatFormatting.BOLD + EnumChatFormatting.GOLD + "\u276F");
diff --git a/src/main/java/eu/olli/cowlection/listener/skyblock/DungeonsListener.java b/src/main/java/eu/olli/cowlection/listener/skyblock/DungeonsListener.java
index 0ea2a0c..c10360b 100644
--- a/src/main/java/eu/olli/cowlection/listener/skyblock/DungeonsListener.java
+++ b/src/main/java/eu/olli/cowlection/listener/skyblock/DungeonsListener.java
@@ -152,6 +152,7 @@ public class DungeonsListener {
while (tooltipIterator.hasNext()) {
String line = tooltipIterator.next();
Matcher lineMatcher = TOOLTIP_LINE_PATTERN.matcher(line);
+ String lineWithoutFormatting = EnumChatFormatting.getTextWithoutFormattingCodes(line);
if (lineMatcher.matches()) {
if (EnumChatFormatting.getTextWithoutFormattingCodes(lineMatcher.group("prefix")).equals("Gear Score: ")) {
// replace meaningless gear score with item quality (gear score includes reforges etc)
@@ -214,6 +215,9 @@ public class DungeonsListener {
tooltipIterator.set(newToolTipLine);
} catch (NumberFormatException ignored) {
}
+ } else if (lineWithoutFormatting.startsWith("Item Ability: ") || lineWithoutFormatting.startsWith("Full Set Bonus: ")) {
+ // stop replacing tooltip entries once we reach item ability or full set bonus
+ break;
}
}
if (itemQualityBottom != null) {
@@ -274,7 +278,7 @@ public class DungeonsListener {
if (inventorySlot.getHasStack()) {
int slotRow = inventorySlot.slotNumber / 9;
int slotColumn = inventorySlot.slotNumber % 9;
- // check if slot is one of the middle slots with actual minions
+ // check if slot is one of the middle slots with parties
int maxRow = inventoryRows - 2;
if (slotRow > 0 && slotRow < maxRow && slotColumn > 0 && slotColumn < 8) {
int slotX = (int) ((guiLeft + inventorySlot.xDisplayPosition) / scaleFactor);
diff --git a/src/main/java/eu/olli/cowlection/util/VersionChecker.java b/src/main/java/eu/olli/cowlection/util/VersionChecker.java
index 8f05beb..b1a9d48 100644
--- a/src/main/java/eu/olli/cowlection/util/VersionChecker.java
+++ b/src/main/java/eu/olli/cowlection/util/VersionChecker.java
@@ -120,7 +120,13 @@ public class VersionChecker {
}
if (statusMsg != null) {
- main.getChatHelper().sendMessage(statusMsg);
+ if (isCommandTriggered) {
+ main.getChatHelper().sendMessage(statusMsg);
+ } else {
+ IChatComponent finalStatusMsg = statusMsg;
+ new TickDelay(() -> main.getChatHelper().sendMessage(finalStatusMsg)
+ , 6 * 20);
+ }
}
}