diff options
author | Empa <42304516+ItsEmpa@users.noreply.github.com> | 2024-09-20 22:48:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-20 22:48:17 +0200 |
commit | 40288e4d66dd53ab6865ac08a90ea843c1bc0f62 (patch) | |
tree | 34d389fc320b77e02d88669a7d71e2dd027b9d8a /src/main/java/at/hannibal2/skyhanni/data | |
parent | 8f7042f1e286890255b7a6f803a2414440be3df2 (diff) | |
download | skyhanni-40288e4d66dd53ab6865ac08a90ea843c1bc0f62.tar.gz skyhanni-40288e4d66dd53ab6865ac08a90ea843c1bc0f62.tar.bz2 skyhanni-40288e4d66dd53ab6865ac08a90ea843c1bc0f62.zip |
Fix: Hardstone and Tungsten detection in Mineshafts (#2536)
Co-authored-by: ItsEmpa <itsempa@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt index fd399ae8b..758294ffc 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.PlaySoundEvent import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent -import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.ServerBlockChangeEvent import at.hannibal2.skyhanni.events.mining.OreMinedEvent import at.hannibal2.skyhanni.events.player.PlayerDeathEvent @@ -59,6 +58,8 @@ object MiningAPI { private var waitingForEffMinerBlock = false var inGlacite = false + var inTunnels = false + var inMineshaft = false var inDwarvenMines = false var inCrystalHollows = false var inCrimsonIsle = false @@ -66,12 +67,13 @@ object MiningAPI { var inSpidersDen = false var currentAreaOreBlocks = setOf<OreBlock>() + private set private var lastSkyblockArea: String? = null private val recentClickedBlocks = ConcurrentSet<Pair<LorenzVec, SimpleTimeMark>>() private val surroundingMinedBlocks = ConcurrentLinkedQueue<Pair<MinedBlock, LorenzVec>>() - private val allowedSoundNames = listOf("dig.glass", "dig.stone", "dig.gravel", "dig.cloth", "random.orb") + private val allowedSoundNames = setOf("dig.glass", "dig.stone", "dig.gravel", "dig.cloth", "random.orb") var cold: Int = 0 private set @@ -117,6 +119,7 @@ object MiningAPI { fun onBlockClick(event: BlockClickEvent) { if (!inCustomMiningIsland()) return if (event.clickType != ClickType.LEFT_CLICK) return + //println(event.getBlockState.properties) if (OreBlock.getByStateOrNull(event.getBlockState) == null) return recentClickedBlocks += event.position to SimpleTimeMark.now() } @@ -142,6 +145,7 @@ object MiningAPI { fun onPlaySound(event: PlaySoundEvent) { if (!inCustomMiningIsland()) return if (event.soundName !in allowedSoundNames) return + //println("Sound: ${event.soundName} ${event.pitch} ${event.volume} ${event.location.toCleanString()}") if (waitingForInitSound) { if (event.soundName != "random.orb" && event.pitch == 0.7936508f) { val pos = event.location.roundLocationToBlock() @@ -176,6 +180,7 @@ object MiningAPI { val pos = event.location if (pos.distanceToPlayer() > 7) return + //println("Block change: $oldState -> $newState ${pos.toCleanString()}") if (lastInitSound.passedSince() > 100.milliseconds) return @@ -288,6 +293,8 @@ object MiningAPI { lastSkyblockArea = currentArea inGlacite = inGlaciteArea() + inTunnels = inGlacialTunnels() + inMineshaft = inMineshaft() inDwarvenMines = inRegularDwarven() inCrystalHollows = inCrystalHollows() inCrimsonIsle = IslandType.CRIMSON_ISLE.isInIsland() |