aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-08-26 12:11:59 +0200
committerGitHub <noreply@github.com>2024-08-26 12:11:59 +0200
commit70e6d63411a48ee6eb8ea398cb9ab0538455d942 (patch)
treeed95c765e1d14368adff5bb29d459de73c222f93 /src/main/java
parent78e5046355d1047e1988b19eaadf155caae159f1 (diff)
downloadskyhanni-70e6d63411a48ee6eb8ea398cb9ab0538455d942.tar.gz
skyhanni-70e6d63411a48ee6eb8ea398cb9ab0538455d942.tar.bz2
skyhanni-70e6d63411a48ee6eb8ea398cb9ab0538455d942.zip
Improvement: Fossil Excavator Reset Command (#2408)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt36
2 files changed, 26 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index f021fe326..a1549aacf 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -55,6 +55,7 @@ import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorDropStatistics
import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryStrayTracker
import at.hannibal2.skyhanni.features.mining.KingTalismanHelper
import at.hannibal2.skyhanni.features.mining.MineshaftPityDisplay
+import at.hannibal2.skyhanni.features.mining.fossilexcavator.ExcavatorProfitTracker
import at.hannibal2.skyhanni.features.mining.powdertracker.PowderTracker
import at.hannibal2.skyhanni.features.minion.MinionFeatures
import at.hannibal2.skyhanni.features.misc.CollectionTracker
@@ -281,6 +282,10 @@ object Commands {
"Resets the Stray Rabbit Tracker",
) { ChocolateFactoryStrayTracker.resetCommand() }
registerCommand(
+ "shresetexcavatortracker",
+ "Resets the Fossil Excavator Profit Tracker",
+ ) { ExcavatorProfitTracker.resetCommand() }
+ registerCommand(
"shfandomwiki",
"Searches the fandom wiki with SkyHanni's own method.",
) { WikiManager.otherWikiCommands(it, true) }
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 4477f509d..dcf9b8c4d 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
@@ -32,7 +32,8 @@ object ExcavatorProfitTracker {
private val tracker = SkyHanniItemTracker(
"Fossil Excavation Profit Tracker",
{ Data() },
- { it.mining.fossilExcavatorProfitTracker }) { drawDisplay(it) }
+ { it.mining.fossilExcavatorProfitTracker },
+ ) { drawDisplay(it) }
class Data : ItemTrackerData() {
override fun resetItems() {
@@ -46,7 +47,7 @@ object ExcavatorProfitTracker {
val dropRate = LorenzUtils.formatPercentage(percentage.coerceAtMost(1.0))
return listOf(
"§7Dropped §e${timesGained.addSeparators()} §7times.",
- "§7Your drop rate: §c$dropRate."
+ "§7Your drop rate: §c$dropRate.",
)
}
@@ -54,7 +55,7 @@ object ExcavatorProfitTracker {
override fun getCoinDescription(item: TrackedItem): List<String> {
return listOf(
- "<no coins>"
+ "<no coins>",
)
}
@@ -78,8 +79,8 @@ object ExcavatorProfitTracker {
addAsSingletonList(
Renderable.hoverTips(
"§7Times excavated: §e${timesExcavated.addSeparators()}",
- listOf("§7You excavated §e${timesExcavated.addSeparators()} §7times.")
- )
+ listOf("§7You excavated §e${timesExcavated.addSeparators()} §7times."),
+ ),
)
profit = addScrap(timesExcavated, profit)
@@ -111,9 +112,9 @@ object ExcavatorProfitTracker {
"§7for all §e$fossilDustGained §fFossil Dust",
"§7you have collected.",
"",
- "§7Price Per Fossil Dust: §6${pricePer.shortFormat()}"
- )
- )
+ "§7Price Per Fossil Dust: §6${pricePer.shortFormat()}",
+ ),
+ ),
)
return profit + fossilDustPrice
}
@@ -127,8 +128,8 @@ object ExcavatorProfitTracker {
listOf(
"§7No real profit,",
"§7but still nice to see! Right?",
- )
- )
+ ),
+ ),
)
}
@@ -146,9 +147,9 @@ object ExcavatorProfitTracker {
listOf(
"§7You paid §c${scrapPrice.shortFormat()} coins §7in total",
"§7for all §e$timesExcavated $name",
- "§7you have used."
- )
- )
+ "§7you have used.",
+ ),
+ ),
)
return profit - scrapPrice
}
@@ -212,6 +213,11 @@ object ExcavatorProfitTracker {
}
}
- fun isEnabled() = IslandType.DWARVEN_MINES.isInIsland() && config.enabled
- && LorenzUtils.skyBlockArea == "Fossil Research Center"
+ fun isEnabled() = IslandType.DWARVEN_MINES.isInIsland() && config.enabled &&
+ LorenzUtils.skyBlockArea == "Fossil Research Center"
+
+ fun resetCommand() {
+ tracker.resetCommand()
+ }
+
}