aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2022-01-06 18:35:16 -0500
committerbowser0000 <bowser0000@gmail.com>2022-01-06 18:35:16 -0500
commitf2cf64f5b1a4894a1e6056efaafff165e41071e2 (patch)
tree3ae6bfd3987ae7529d73632737e20c987d62cc5e /src/main/java/me/Danker/features
parentdda83961a0922b5753c7d4dd3e239a925d3afa7a (diff)
downloadSkyblockMod-f2cf64f5b1a4894a1e6056efaafff165e41071e2.tar.gz
SkyblockMod-f2cf64f5b1a4894a1e6056efaafff165e41071e2.tar.bz2
SkyblockMod-f2cf64f5b1a4894a1e6056efaafff165e41071e2.zip
Actually fix dungeon coins spent
Diffstat (limited to 'src/main/java/me/Danker/features')
-rw-r--r--src/main/java/me/Danker/features/loot/CatacombsTracker.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/me/Danker/features/loot/CatacombsTracker.java b/src/main/java/me/Danker/features/loot/CatacombsTracker.java
index 86770d6..c4b9634 100644
--- a/src/main/java/me/Danker/features/loot/CatacombsTracker.java
+++ b/src/main/java/me/Danker/features/loot/CatacombsTracker.java
@@ -188,7 +188,7 @@ public class CatacombsTracker {
public void onChat(ClientChatReceivedEvent event) {
String message = StringUtils.stripControlCodes(event.message.getUnformattedText());
- if (!Utils.inSkyblock) return;
+ if (!Utils.inDungeons) return;
if (event.type == 2) return;
if (message.contains(" Team Score: ") && message.contains("(S+)")) {
@@ -492,17 +492,17 @@ public class CatacombsTracker {
@SubscribeEvent
public void onSlotClick(ChestSlotClickedEvent event) {
+ if (!Utils.inDungeons) return;
+
ItemStack item = event.item;
if (event.inventoryName.endsWith(" Chest") && item != null) {
if (item.getDisplayName().contains("Open Reward Chest")) {
- List<String> tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
+ List<String> tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, false);
for (String lineUnclean : tooltip) {
String line = StringUtils.stripControlCodes(lineUnclean);
- if (line.contains("FREE")) {
- continue;
- } else if (line.contains(" Coins") && !line.contains("NOTE:")) {
- int coinsSpent = Integer.parseInt(line.substring(0, line.indexOf(" ")).replaceAll(",", ""));
+ if (line.contains(" Coins") && !line.contains("NOTE:")) {
+ int coinsSpent = Integer.parseInt(line.replaceAll("[^\\d]", ""));
List<String> scoreboard = ScoreboardHandler.getSidebarLines();
for (String s : scoreboard) {
@@ -541,9 +541,10 @@ public class CatacombsTracker {
masterCoinsSpentSession += coinsSpent;
ConfigHandler.writeDoubleConfig("catacombs", "masterCoins", masterCoinsSpent);
}
+ break;
}
- break;
}
+ break;
}
}
} else if (item.getDisplayName().contains("Reroll Chest")) {