diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt | 14 |
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()) { |