aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--CHANGELOG.md7
-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
4 files changed, 22 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b047e1e..ff141ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
+## [1.8.9-xxx] - unreleased
+### Fixed
+- Remove ": " when copying chat messages
+- Fix dungeon tooltip cleaner cleaning a little bit too much
+- Temporary work-around to fix crash with other mods which are not able to handle offline messages
+
## [1.8.9-0.9.0] - 23.07.2020
### Added
- Added SkyBlock Dungeon deaths counter
@@ -138,6 +144,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
*Note:* The 'best friends' list is currently available via <kbd>ESC</kbd> > Mod Options > Cowlection > Config > bestFriends.
+[1.8.9-xxx]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.9.0...master
[1.8.9-0.9.0]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.8.1...v1.8.9-0.9.0
[1.8.9-0.8.1]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.8.0...v1.8.9-0.8.1
[1.8.9-0.8.0]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.7.1...v1.8.9-0.8.0
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);
+ }
}
}