From b10906fc55a480675c9dcea9e402792791af6916 Mon Sep 17 00:00:00 2001 From: Fluboxer Date: Wed, 21 Feb 2024 15:04:59 +0300 Subject: 1st iteration of calculator for Croesus I did testings on M5 and M6 drops and so far it were working properly. Only thing I'm unsure is spirit pet and yes it does use big map for every dungeon drop lmao --- src/main/resources/assets/skyblocker/lang/en_us.json | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 60631ef1..c8ac97c5 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -252,6 +252,8 @@ "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.lossColor": "Loss Color", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "Croesus Helper", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Gray out chests that have already been opened.", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit": "Croesus Chest Profit Calculator", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit.@Tooltip": "Highlight chests with best profit at Croesus NPC", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", "text.autoconfig.skyblocker.option.locations.dungeons.mapScreen": "Dungeon Map & Score Placement Config...", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Map Scaling", -- cgit From 58592dc66af8e3986a828f5203bc16d3c5684a27 Mon Sep 17 00:00:00 2001 From: Fluboxer Date: Wed, 21 Feb 2024 15:41:21 +0300 Subject: extra clarification --- src/main/resources/assets/skyblocker/lang/en_us.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index c8ac97c5..2e22d0c3 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -253,7 +253,7 @@ "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "Croesus Helper", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Gray out chests that have already been opened.", "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit": "Croesus Chest Profit Calculator", - "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit.@Tooltip": "Highlight chests with best profit at Croesus NPC", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit.@Tooltip": "Highlight chests with best profit at Croesus NPC.\n\n\nBest chest will be highlighted green.\nIf there is a chest worth using dungeon key on, it will be highlighted yellow", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", "text.autoconfig.skyblocker.option.locations.dungeons.mapScreen": "Dungeon Map & Score Placement Config...", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Map Scaling", -- cgit From 47a0a13fa31af73a6c1314b5b178a503216a057a Mon Sep 17 00:00:00 2001 From: Fluboxer Date: Wed, 21 Feb 2024 22:03:22 +0300 Subject: typo --- src/main/resources/assets/skyblocker/lang/en_us.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 2e22d0c3..7cfbcce6 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -253,8 +253,7 @@ "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "Croesus Helper", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Gray out chests that have already been opened.", "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit": "Croesus Chest Profit Calculator", - "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit.@Tooltip": "Highlight chests with best profit at Croesus NPC.\n\n\nBest chest will be highlighted green.\nIf there is a chest worth using dungeon key on, it will be highlighted yellow", - "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", + "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit.@Tooltip": "Highlights chests with the best profit at the Croesus NPC.\n\n\nThe best chest will be highlighted green.\nIf there is a chest worth using dungeon key on, it will be highlighted yellow", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", "text.autoconfig.skyblocker.option.locations.dungeons.mapScreen": "Dungeon Map & Score Placement Config...", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Map Scaling", "text.autoconfig.skyblocker.option.locations.dungeons.playerSecretsTracker": "Player Secrets Tracker", -- cgit From eaac3c5b7c72f9953aa7f2c41ca9ad0873f7464e Mon Sep 17 00:00:00 2001 From: Fluboxer Date: Wed, 21 Feb 2024 23:22:44 +0300 Subject: minor improvements --- .../de/hysky/skyblocker/config/SkyblockerConfig.java | 6 +++--- .../skyblocker/config/categories/DungeonsCategory.java | 16 ++++++++-------- .../hysky/skyblocker/skyblock/dungeon/CroesusProfit.java | 13 ++++--------- src/main/resources/assets/skyblocker/lang/en_us.json | 4 ++-- 4 files changed, 17 insertions(+), 22 deletions(-) (limited to 'src/main/resources/assets') diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index f8bd61d4..713a9fbd 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -683,9 +683,6 @@ public class SkyblockerConfig { @SerialEntry public boolean croesusHelper = true; - @SerialEntry - public boolean croesusProfit = true; - @SerialEntry public boolean enableMap = true; @@ -868,6 +865,9 @@ public class SkyblockerConfig { @SerialEntry public boolean includeEssence = true; + @SerialEntry + public boolean croesusProfit = true; + @SerialEntry public int neutralThreshold = 1000; diff --git a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java index f22d9584..9d6e1beb 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -279,6 +279,14 @@ public class DungeonsCategory { newValue -> config.locations.dungeons.dungeonChestProfit.includeEssence = newValue) .controller(ConfigUtils::createBooleanController) .build()) + .option(Option.createBuilder() + .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.croesusProfit")) + .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.croesusProfit.@Tooltip"))) + .binding(defaults.locations.dungeons.dungeonChestProfit.croesusProfit, + () -> config.locations.dungeons.dungeonChestProfit.croesusProfit, + newValue -> config.locations.dungeons.dungeonChestProfit.croesusProfit = newValue) + .controller(ConfigUtils::createBooleanController) + .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold")) .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold.@Tooltip"))) @@ -327,14 +335,6 @@ public class DungeonsCategory { newValue -> config.locations.dungeons.croesusHelper = newValue) .controller(ConfigUtils::createBooleanController) .build()) - .option(Option.createBuilder() - .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit")) - .description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit.@Tooltip"))) - .binding(defaults.locations.dungeons.croesusProfit, - () -> config.locations.dungeons.croesusProfit, - newValue -> config.locations.dungeons.croesusProfit = newValue) - .controller(ConfigUtils::createBooleanController) - .build()) .option(Option.createBuilder() .name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.enableMap")) .binding(defaults.locations.dungeons.enableMap, diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CroesusProfit.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CroesusProfit.java index a2a82aee..c6099e3e 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CroesusProfit.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/CroesusProfit.java @@ -2,17 +2,13 @@ package de.hysky.skyblocker.skyblock.dungeon; import com.google.gson.JsonObject; import de.hysky.skyblocker.config.SkyblockerConfigManager; -import de.hysky.skyblocker.skyblock.item.tooltip.ItemTooltip; import de.hysky.skyblocker.skyblock.item.tooltip.TooltipInfoType; import de.hysky.skyblocker.utils.render.gui.ColorHighlight; import de.hysky.skyblocker.utils.render.gui.ContainerSolver; -import it.unimi.dsi.fastutil.longs.LongBooleanPair; +import de.hysky.skyblocker.utils.ItemUtils; import net.minecraft.client.item.TooltipContext; import net.minecraft.item.ItemStack; import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.NotNull; import java.util.*; @@ -20,7 +16,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class CroesusProfit extends ContainerSolver { - private static final Logger LOGGER = LogManager.getLogger(); private static final Pattern ESSENCE_PATTERN = Pattern.compile("(?[A-Za-z]+) Essence x(?[0-9]+)"); private static final Pattern CHEST_PATTERN = Pattern.compile("literal\\{(.*?) Chest}"); public CroesusProfit() { @@ -29,7 +24,7 @@ public class CroesusProfit extends ContainerSolver { @Override protected boolean isEnabled() { - return SkyblockerConfigManager.get().locations.dungeons.croesusProfit; + return SkyblockerConfigManager.get().locations.dungeons.dungeonChestProfit.croesusProfit; } @Override @@ -37,7 +32,7 @@ public class CroesusProfit extends ContainerSolver { List highlights = new ArrayList<>(); ItemStack bestChest = null, secondBestChest = null; long bestValue = 0, secondBestValue = 0; // If negative value of chest - it is out of the question - long dungeonKeyPriceData = getItemPrice("DUNGEON_CHEST_KEY")*2; // lesser ones don't worth the hassle + long dungeonKeyPriceData = getItemPrice("DUNGEON_CHEST_KEY") * 2; // lesser ones don't worth the hassle for (Map.Entry entry : slots.entrySet()) { ItemStack stack = entry.getValue(); @@ -78,7 +73,7 @@ public class CroesusProfit extends ContainerSolver { String chestType = (matcher.find() ? matcher.group(1) : "Error"); // we are doing it for sole reason of saving us headache of a spirit pet rarity boolean processingContents = false; - for (Text line : chest.getTooltip(null, TooltipContext.BASIC)) { + for (Text line : ItemUtils.getNbtTooltips(chest)) { String lineString = line.getString(); if (lineString.contains("Contents")) { processingContents = true; diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 7cfbcce6..63ff4fca 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -245,6 +245,8 @@ "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeKismet.@Tooltip": "When enabled, if you used a kismet the price of one will be subtracted from the profit", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence": "Include Essence", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence.@Tooltip": "Disabling is **not recommended** if you're a forgetful person.", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.croesusProfit": "Croesus Chest Profit Calculator", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.croesusProfit.@Tooltip": "Highlights chests with the best profit at the Croesus NPC.\n\n\nThe best chest will be highlighted green.\nIf there is a chest worth using dungeon key on, it will be highlighted yellow", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold": "Neutral Threshold", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold.@Tooltip": "The threshold below which the profit is considered neutral.", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralColor": "Neutral Color", @@ -252,8 +254,6 @@ "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.lossColor": "Loss Color", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper": "Croesus Helper", "text.autoconfig.skyblocker.option.locations.dungeons.croesusHelper.@Tooltip": "Gray out chests that have already been opened.", - "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit": "Croesus Chest Profit Calculator", - "text.autoconfig.skyblocker.option.locations.dungeons.croesusProfit.@Tooltip": "Highlights chests with the best profit at the Croesus NPC.\n\n\nThe best chest will be highlighted green.\nIf there is a chest worth using dungeon key on, it will be highlighted yellow", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", "text.autoconfig.skyblocker.option.locations.dungeons.mapScreen": "Dungeon Map & Score Placement Config...", "text.autoconfig.skyblocker.option.locations.dungeons.mapScaling": "Map Scaling", "text.autoconfig.skyblocker.option.locations.dungeons.playerSecretsTracker": "Player Secrets Tracker", -- cgit From 554c1716824e289a307e8fca15798b42bdd4c566 Mon Sep 17 00:00:00 2001 From: Fluboxer Date: Thu, 29 Feb 2024 16:33:19 +0300 Subject: fix typo --- src/main/resources/assets/skyblocker/lang/en_us.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index f5875feb..a8eed87e 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -249,7 +249,8 @@ "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence": "Include Essence", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.includeEssence.@Tooltip": "Disabling is **not recommended** if you're a forgetful person.", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.croesusProfit": "Croesus Chest Profit Calculator", - "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.croesusProfit.@Tooltip": "Highlights chests with the best profit at the Croesus NPC.\n\n\nThe best chest will be highlighted green.\nIf there is a chest worth using dungeon key on, it will be highlighted yellow", "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", + "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.croesusProfit.@Tooltip": "Highlights chests with the best profit at the Croesus NPC.\n\n\nThe best chest will be highlighted green.\nIf there is a chest worth using dungeon key on, it will be highlighted yellow", + "text.autoconfig.skyblocker.option.locations.dungeons.enableMap": "Enable Map", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold": "Neutral Threshold", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralThreshold.@Tooltip": "The threshold below which the profit is considered neutral.", "text.autoconfig.skyblocker.option.locations.dungeons.dungeonChestProfit.neutralColor": "Neutral Color", -- cgit