aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-05-02 09:32:18 +0200
committerGitHub <noreply@github.com>2024-05-02 09:32:18 +0200
commita7980cdb60aede5cd269cbc4c4c5f3ec44fff98a (patch)
treeaf77886112e4266974141fd2d6fbd8903b03d7e8 /src/main/java/at
parentf8c3a8f95291c8e89ad3f2455ebd87cf4f5fbe83 (diff)
downloadskyhanni-a7980cdb60aede5cd269cbc4c4c5f3ec44fff98a.tar.gz
skyhanni-a7980cdb60aede5cd269cbc4c4c5f3ec44fff98a.tar.bz2
skyhanni-a7980cdb60aede5cd269cbc4c4c5f3ec44fff98a.zip
Fix: Excavator Profile Tracker (#1628)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt5
3 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt
index f0a3fcaa8..2586f2257 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt
@@ -58,7 +58,11 @@ class ExcavatorProfitTracker {
@Expose
var timesExcavated = 0L
+
+ @Expose
var glacitePowderGained = 0L
+
+ @Expose
var fossilDustGained = 0L
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt
index aef3e865b..def47812c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt
@@ -112,7 +112,7 @@ object FossilExcavatorAPI {
ItemUtils.readItemAmount(group("item"))
} ?: return
// Workaround: If it is a enchanted book, we assume it is a paleontologist I book
- if (pair.first.let { it == "§fEnchanted" || it == "§fEnchanted Book"}) {
+ if (pair.first.let { it == "§fEnchanted" || it == "§fEnchanted Book" }) {
pair = "Paleontologist I" to pair.second
}
loot.add(pair)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt
index 4ac8dd4ff..52b2f2447 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt
@@ -21,10 +21,11 @@ class ProfitPerExcavation {
var totalProfit = 0.0
val map = mutableMapOf<String, Double>()
- loot.forEach { (name, amount) ->
+ for ((name, amount) in loot) {
+ if (name == "§bGlacite Powder") continue
NEUInternalName.fromItemNameOrNull(name)?.let {
val pricePer = it.getPrice()
- if (pricePer == -1.0) return@forEach
+ if (pricePer == -1.0) continue
val profit = amount * pricePer
val text = "Found $name §8${amount.addSeparators()}x §7(§6${NumberUtil.format(profit)}§7)"
map[text] = profit