aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-10-07 13:48:03 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-10-07 13:48:03 +0200
commit2e13dbc1d038090566dd630559b290b3991aa181 (patch)
tree6fecd1e9e6db073f2c8af3ea1759d924825a125d /src/main/java/at/hannibal2
parentf53fbddd604fd795780f16c25f57378c32d18763 (diff)
downloadskyhanni-2e13dbc1d038090566dd630559b290b3991aa181.tar.gz
skyhanni-2e13dbc1d038090566dd630559b290b3991aa181.tar.bz2
skyhanni-2e13dbc1d038090566dd630559b290b3991aa181.zip
only show mining api data in /shdebug after mining ores
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt
index 45aec43d3..47133f199 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt
@@ -74,7 +74,7 @@ object MiningAPI {
*/
private val pickobulusFailPattern by pickbobulusGroup.pattern(
"fail",
- "§7Your §r§aPickobulus §r§7didn't destroy any blocks!"
+ "§7Your §r§aPickobulus §r§7didn't destroy any blocks!",
)
private data class MinedBlock(val ore: OreBlock, var confirmed: Boolean) {
@@ -127,6 +127,8 @@ object MiningAPI {
var lastColdReset = SimpleTimeMark.farPast()
private set
+ private var lastOreMinedTime = SimpleTimeMark.farPast()
+
fun inGlaciteArea() = inGlacialTunnels() || IslandType.MINESHAFT.isInIsland()
fun inDwarvenBaseCamp() = IslandType.DWARVEN_MINES.isInIsland() && dwarvenBaseCampPattern.matches(LorenzUtils.skyBlockArea)
@@ -341,6 +343,7 @@ object MiningAPI {
currentAreaOreBlocks = setOf()
resetOreEvent()
resetPickobulusEvent()
+ lastOreMinedTime = SimpleTimeMark.farPast()
}
private fun resetOreEvent() {
@@ -359,6 +362,11 @@ object MiningAPI {
pickobulusWaitingForBlock = false
}
+ @HandleEvent(onlyOnSkyblock = true)
+ fun onOreMined(event: OreMinedEvent) {
+ lastOreMinedTime = SimpleTimeMark.now()
+ }
+
@SubscribeEvent
fun onDebugDataCollect(event: DebugDataCollectEvent) {
event.title("Mining API")
@@ -366,6 +374,10 @@ object MiningAPI {
event.addIrrelevant("not in a mining island")
return
}
+ if (lastOreMinedTime.passedSince() > 30.seconds) {
+ event.addIrrelevant("not mined recently")
+ return
+ }
event.addData {
if (lastInitSound.isFarPast()) {