aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-10-28 19:40:44 +0100
committerGitHub <noreply@github.com>2023-10-28 20:40:44 +0200
commit71371b909fff712cbd92a3e7bc1c85a8c92ae870 (patch)
treecf43b54e5feb3e16f5de2c7f72ccdfa2cb0a9e51 /src/main/java/at
parentc1149d3c1b0d1f47bc6b0c1c65a70e5174022025 (diff)
downloadskyhanni-71371b909fff712cbd92a3e7bc1c85a8c92ae870.tar.gz
skyhanni-71371b909fff712cbd92a3e7bc1c85a8c92ae870.tar.bz2
skyhanni-71371b909fff712cbd92a3e7bc1c85a8c92ae870.zip
Add Diamond and Gold Essence Support to PowderTracker (#618)
Add Diamond and Gold Essence Support to PowderTracker #618
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt44
3 files changed, 50 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java
index 38ac5f1d3..198f8d1d0 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiningConfig.java
@@ -52,6 +52,9 @@ public class MiningConfig {
"§b250,420 §aMithril Powder §7(350,000/h)",
"§b250,420 §dGemstone Powder §7(350,000/h)",
"",
+ "§b129 §bDiamond Essence §7(600/h)",
+ "§b234 §6Gold Essence §7(700/h)",
+ "",
"§50§7-§90§7-§a0§f-0 §cRuby Gemstone",
"§50§7-§90§7-§a0§f-0 §bSapphire Gemstone",
"§50§7-§90§7-§a0§f-0 §6Amber Gemstone",
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt
index 656397b94..19a7f8274 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderChestReward.kt
@@ -145,4 +145,7 @@ enum class PowderChestReward(val displayName: String, val pattern: Pattern) {
YOGGIE("§aYoggie", "§aYou received §r§f(?<amount>.*) §r§aYoggie§r§a.".toPattern()),
PREHISTORIC_EGG("§fPrehistoric Egg", "§aYou received §r§f(?<amount>.*) §r§fPrehistoric Egg§r§a.".toPattern()),
OIL_BARREL("§aOil Barrel", "§aYou received §r§f(?<amount>.*) §r§aOil Barrel§r§a.".toPattern()),
-} \ No newline at end of file
+
+ DIAMOND_ESSENCE("§bDiamond Essence", "§aYou received §r§b[+](?<amount>.*) Diamond Essence".toPattern()),
+ GOLD_ESSENCE("§6Gold Essence", "§aYou received §r§6[+](?<amount>.*) Gold Essence".toPattern()),
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
index bb715d9f5..6bace1ced 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
@@ -37,6 +37,8 @@ class PowderTracker {
private var isGrinding = false
private val gemstoneInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
private val mithrilInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
+ private val diamondEssenceInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
+ private val goldEssenceInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
private val chestInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
private var doublePowder = false
private var powderTimer = ""
@@ -57,6 +59,8 @@ class PowderTracker {
if (!isEnabled()) return@fixedRateTimer
calculateResourceHour(gemstoneInfo)
calculateResourceHour(mithrilInfo)
+ calculateResourceHour(diamondEssenceInfo)
+ calculateResourceHour(goldEssenceInfo)
calculateResourceHour(chestInfo)
}
}
@@ -151,6 +155,12 @@ class PowderTracker {
mithrilInfo.perHour = 0.0
mithrilInfo.stoppedChecks = 0
mithrilInfo.perMin.clear()
+ diamondEssenceInfo.perHour = 0.0
+ diamondEssenceInfo.stoppedChecks = 0
+ diamondEssenceInfo.perMin.clear()
+ goldEssenceInfo.perHour = 0.0
+ goldEssenceInfo.stoppedChecks = 0
+ goldEssenceInfo.perMin.clear()
chestInfo.perHour = 0.0
chestInfo.stoppedChecks = 0
chestInfo.perMin.clear()
@@ -166,6 +176,8 @@ class PowderTracker {
private fun saveAndUpdate() {
calculateGemstone()
calculateMithril()
+ calculateDiamondEssence()
+ calculateGoldEssence()
calculateChest()
display = formatDisplay(drawDisplay())
}
@@ -213,6 +225,20 @@ class PowderTracker {
addAsSingletonList("")
+ val diamondEssence = PowderChestReward.entries[46]
+ val diamondEssenceCount = rewards.getOrDefault(diamondEssence, 0).addSeparators()
+ val diamondEssencePerHour = if (diamondEssenceInfo.perHour < 0) 0 else diamondEssenceInfo.perHour.toInt().addSeparators()
+ addAsSingletonList("§b$diamondEssenceCount ${diamondEssence.displayName} §7($diamondEssencePerHour/h)")
+
+ val goldEssence = PowderChestReward.entries[47]
+ val goldEssenceCount = rewards.getOrDefault(goldEssence, 0).addSeparators()
+ val goldEssencePerHour = if (goldEssenceInfo.perHour < 0) 0 else goldEssenceInfo.perHour.toInt().addSeparators()
+ addAsSingletonList("§b$goldEssenceCount ${goldEssence.displayName} §7($goldEssencePerHour/h)")
+
+
+ addAsSingletonList("")
+
+
for ((gem, color) in gemstones) {
var totalGemstone = 0L
@@ -295,6 +321,22 @@ class PowderTracker {
mithrilInfo.estimated += rewards.getOrDefault(PowderChestReward.MITHRIL_POWDER, 0)
}
+ private fun calculateDiamondEssence(){
+ val both = currentLog() ?: return
+ val display = both.get(currentDisplayMode)
+ val rewards = display.rewards
+ diamondEssenceInfo.estimated = 0
+ diamondEssenceInfo.estimated += rewards.getOrDefault(PowderChestReward.DIAMOND_ESSENCE, 0)
+ }
+
+ private fun calculateGoldEssence(){
+ val both = currentLog() ?: return
+ val display = both.get(currentDisplayMode)
+ val rewards = display.rewards
+ goldEssenceInfo.estimated = 0
+ goldEssenceInfo.estimated += rewards.getOrDefault(PowderChestReward.GOLD_ESSENCE, 0)
+ }
+
private fun calculateChest() {
val both = currentLog() ?: return
val display = both.get(currentDisplayMode)
@@ -363,4 +405,4 @@ class PowderTracker {
private fun isEnabled() =
LorenzUtils.inSkyBlock && LorenzUtils.skyBlockIsland == IslandType.CRYSTAL_HOLLOWS && config.enabled
-} \ No newline at end of file
+}