summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/rift
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt22
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt4
5 files changed, 20 insertions, 27 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
index 17af7fd1a..7b673f65e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
@@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.features.rift.area.livingcave
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.events.ServerBlockChangeEvent
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
@@ -31,11 +31,9 @@ class LivingCaveDefenseBlocks {
class DefenseBlock(val entity: EntityOtherPlayerMP, val location: LorenzVec, var hidden: Boolean = false)
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- staticBlocks = staticBlocks.editCopy { removeIf { it.entity.isDead } }
- }
+ staticBlocks = staticBlocks.editCopy { removeIf { it.entity.isDead } }
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt
index aa8bc1889..f64d5b42c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt
@@ -1,7 +1,7 @@
package at.hannibal2.skyhanni.features.rift.area.livingcave
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.InventoryUtils
@@ -56,9 +56,8 @@ class LivingMetalSuitProgress {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
- if (!event.repeatSeconds(1)) return
val old = progressMap
progressMap = buildMap {
for (armor in InventoryUtils.getArmor().filterNotNull()) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt
index 261229e09..b31c7fb40 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt
@@ -28,24 +28,22 @@ import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.time.Duration.Companion.minutes
-class RiftBloodEffigies {
+object RiftBloodEffigies {
private val config get() = RiftAPI.config.area.stillgoreChateau.bloodEffigies
private var locations: List<LorenzVec> = emptyList()
private var effigiesTimes = cleanMap()
- companion object {
- private val group = RepoPattern.group("rift.area.stillgore.effegies")
- val effigiesTimerPattern by group.pattern(
- "respawn",
- "§eRespawn §c(?<time>.*) §7\\(or click!\\)"
- )
- val heartsPattern by group.pattern(
- "heart",
- "Effigies: (?<hearts>((§[7c])?⧯)*)"
- )
- }
+ private val patternGroup = RepoPattern.group("rift.area.stillgore.effegies")
+ private val effigiesTimerPattern by patternGroup.pattern(
+ "respawn",
+ "§eRespawn §c(?<time>.*) §7\\(or click!\\)"
+ )
+ val heartsPattern by patternGroup.pattern(
+ "heart",
+ "Effigies: (?<hearts>((§[7c])?⧯)*)"
+ )
@SubscribeEvent
fun onWorldChange(event: LorenzWorldChangeEvent) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt
index 83890c360..2470eacda 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt
@@ -7,8 +7,8 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.InventoryUtils
@@ -39,11 +39,9 @@ class KloonHacking {
private var nearestTerminal: KloonTerminal? = null
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!RiftAPI.inRift()) return
- if (event.repeatSeconds(1)) {
- checkHelmet()
- }
+ checkHelmet()
}
private fun checkHelmet() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt
index a38de4fd3..7ba556680 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt
@@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.rift.everywhere
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.ConditionalUtils
@@ -86,7 +86,7 @@ object CruxTalismanDisplay {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
if (!event.repeatSeconds(2)) return
if (!InventoryUtils.getItemsInOwnInventory().any { it.getInternalName().startsWith(partialName) }) return