summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorEmpa <42304516+ItsEmpa@users.noreply.github.com>2024-06-15 22:12:24 +0200
committerGitHub <noreply@github.com>2024-06-15 22:12:24 +0200
commitbfe43b7ebffab551740d32cf919db27504d27ffb (patch)
tree7fb570635c88d98f122d2752be78f135868a9843 /src/main/java/at/hannibal2/skyhanni/test
parent8c91a9b8bf63059e1a8a099ccbdadea8a3676948 (diff)
downloadskyhanni-bfe43b7ebffab551740d32cf919db27504d27ffb.tar.gz
skyhanni-bfe43b7ebffab551740d32cf919db27504d27ffb.tar.bz2
skyhanni-bfe43b7ebffab551740d32cf919db27504d27ffb.zip
Feature: Mineshaft Pity Display + OreMinedEvent (#1655)
Co-authored-by: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Co-authored-by: Empa <42304516+ItsEmpa@users.noreply.github.com> Co-authored-by: Thunderblade73 <gaidermarkus@gmail.com> Co-authored-by: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index 4e1c51de3..ce1b5eea7 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.test
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.config.ConfigFileType
import at.hannibal2.skyhanni.config.ConfigGuiManager
import at.hannibal2.skyhanni.config.ConfigManager
@@ -13,10 +14,14 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
+import at.hannibal2.skyhanni.events.mining.OreMinedEvent
import at.hannibal2.skyhanni.features.garden.GardenNextJacobContest
import at.hannibal2.skyhanni.features.garden.visitor.GardenVisitorColorNames
import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi.getBazaarData
+import at.hannibal2.skyhanni.features.mining.OreBlock
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
+import at.hannibal2.skyhanni.utils.BlockUtils
+import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
import at.hannibal2.skyhanni.utils.InventoryUtils
@@ -504,13 +509,27 @@ object SkyHanniDebugsAndTests {
itemRenderDebug()
}
- if (Minecraft.getMinecraft().gameSettings.showDebugInfo && debugConfig.currentAreaDebug) {
- config.debugLocationPos.renderString(
- "Current Area: ${HypixelData.skyBlockArea}",
- posLabel = "SkyBlock Area (Debug)",
- )
+ if (Minecraft.getMinecraft().gameSettings.showDebugInfo) {
+ if (debugConfig.currentAreaDebug) {
+ config.debugLocationPos.renderString(
+ "Current Area: ${HypixelData.skyBlockArea}",
+ posLabel = "SkyBlock Area (Debug)",
+ )
+ }
+
+ if (debugConfig.raytracedOreblock) {
+ BlockUtils.getBlockLookingAt(50.0)?.let { pos ->
+ OreBlock.getByStateOrNull(pos.getBlockStateAt())?.let { ore ->
+ config.debugOrePos.renderString(
+ "Looking at: ${ore.name} (${pos.toCleanString()})",
+ posLabel = "OreBlock"
+ )
+ }
+ }
+ }
}
+
if (!debugConfig.enabled) return
if (displayLine.isNotEmpty()) {
@@ -549,6 +568,14 @@ object SkyHanniDebugsAndTests {
)
}
+ @HandleEvent(onlyOnSkyblock = true)
+ fun onOreMined(event: OreMinedEvent) {
+ if (!debugConfig.oreEventMessages) return
+ val originalOre = event.originalOre
+ val extraBlocks = event.extraBlocks.map { "${it.key.name}: ${it.value}" }
+ ChatUtils.debug("Mined: $originalOre (${extraBlocks.joinToString()})")
+ }
+
@SubscribeEvent
fun onReceiveParticle(event: ReceiveParticleEvent) {
// val particleType = event.type