summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/mining
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt27
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt10
2 files changed, 18 insertions, 19 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt
index dcc39c8b9..14999c107 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt
@@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.SecondPassedEvent
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.sorted
import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc
@@ -23,7 +24,8 @@ import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.Collections
-class KingTalismanHelper {
+@SkyHanniModule
+object KingTalismanHelper {
private val config get() = SkyHanniMod.feature.mining.kingTalisman
private val storage get() = ProfileStorageData.profileSpecific?.mining
@@ -33,22 +35,19 @@ class KingTalismanHelper {
"§6§lKing (?<name>.*)"
)
- companion object {
+ private var currentOffset: Int? = null
+ private var skyblockYear = 0
- private var currentOffset: Int? = null
- private var skyblockYear = 0
-
- private fun getCurrentOffset(): Int? {
- if (SkyBlockTime.now().year != skyblockYear) {
- return null
- }
- return currentOffset
+ private fun getCurrentOffset(): Int? {
+ if (SkyBlockTime.now().year != skyblockYear) {
+ return null
}
+ return currentOffset
+ }
- fun kingFix() {
- currentOffset = null
- ChatUtils.chat("Reset internal offset of King Talisman Helper.")
- }
+ fun kingFix() {
+ currentOffset = null
+ ChatUtils.chat("Reset internal offset of King Talisman Helper.")
}
private val kingLocation = LorenzVec(129.6, 196.5, 194.1)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt
index 698335f27..44fc087c7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt
@@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.events.IslandChangeEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.SecondPassedEvent
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.APIUtil
import at.hannibal2.skyhanni.utils.ChatUtils
@@ -29,7 +30,8 @@ import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds
-class MiningEventTracker {
+@SkyHanniModule
+object MiningEventTracker {
private val config get() = SkyHanniMod.feature.mining.miningEvent
private val patternGroup = RepoPattern.group("mining.eventtracker")
@@ -59,11 +61,9 @@ class MiningEventTracker {
private var canRequestAt = SimpleTimeMark.farPast()
- companion object {
- var apiErrorCount = 0
+ var apiErrorCount = 0
- val apiError get() = apiErrorCount > 0
- }
+ val apiError get() = apiErrorCount > 0
@SubscribeEvent
fun onWorldChange(event: LorenzWorldChangeEvent) {