aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-06-06 00:01:30 +1000
committerGitHub <noreply@github.com>2024-06-05 16:01:30 +0200
commiteb7fd3da94cec90674e29e93ca0d744e2a2889fb (patch)
treea83d663c1229207b0cf5977290aa2609ba22efec /src/main/java/at
parent5a04ad230cc4fb94884b34f795124d3b65af07ea (diff)
downloadskyhanni-eb7fd3da94cec90674e29e93ca0d744e2a2889fb.tar.gz
skyhanni-eb7fd3da94cec90674e29e93ca0d744e2a2889fb.tar.bz2
skyhanni-eb7fd3da94cec90674e29e93ca0d744e2a2889fb.zip
Backend: More second passed (#1899)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt120
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt10
16 files changed, 109 insertions, 139 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index a3143ee36..888fc7210 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -698,7 +698,7 @@ class SkyHanniMod {
loadModule(HoppityCollectionData)
loadModule(HoppityCollectionStats)
loadModule(SpawnTimers())
- loadModule(MarkedPlayerManager())
+ loadModule(MarkedPlayerManager)
loadModule(SlayerMiniBossFeatures())
loadModule(PlayerDeathMessages())
loadModule(HighlightDungeonDeathmite())
diff --git a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt
index 51f9fb6be..c9ca7f62d 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt
@@ -3,10 +3,10 @@ package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.data.jsonobjects.repo.ArrowTypeJson
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.OwnInventoryItemUpdateEvent
import at.hannibal2.skyhanni.events.QuiverUpdateEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemCategory
@@ -273,7 +273,7 @@ object QuiverAPI {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
if (event.repeatSeconds(2)) {
checkChestplate()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt
index 005d9b8f1..887839d27 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt
@@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.event.diana
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.BurrowDetectEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
@@ -32,9 +32,8 @@ object AllBurrowsList {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
- if (!event.repeatSeconds(1)) return
val burrowLocations = burrowLocations ?: return
val range = 5..70
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt
index 1a8fde100..330727347 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt
@@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.data.HypixelData
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.LocationUtils.distanceSqToPlayer
import at.hannibal2.skyhanni.utils.LorenzColor
@@ -37,13 +37,11 @@ class EasterEggWaypoints {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!config.allWaypoints && !config.allEntranceWaypoints) return
if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- isEgg = checkScoreboardEasterSpecific()
- }
+ isEgg = checkScoreboardEasterSpecific()
if (isEgg) {
if (config.onlyClosest) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt
index da267da07..8eb9e1dc1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt
@@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.data.HypixelData
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.LocationUtils.distanceSqToPlayer
import at.hannibal2.skyhanni.utils.LorenzColor
@@ -38,13 +38,11 @@ class BasketWaypoints {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!config.allWaypoints && !config.allEntranceWaypoints) return
if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- isHalloween = checkScoreboardHalloweenSpecific()
- }
+ isHalloween = checkScoreboardHalloweenSpecific()
if (isHalloween) {
if (config.onlyClosest) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt b/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt
index d8ff05378..f5f05f8ca 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt
@@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.event.spook
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.SoundUtils
@@ -19,9 +19,8 @@ class TheGreatSpook {
private var notificationSeconds = 0
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (isAllDisabled()) return
- if (!event.repeatSeconds(1)) return
if (isTimerEnabled() || isNotificationEnabled()) displayTimer = checkTabList(" §r§cPrimal Fears§r§7: ")
if (isFearStatEnabled()) displayFearStat = checkTabList(" §r§5Fear: ")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt
index ea33bc7ec..445f0e984 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt
@@ -3,9 +3,9 @@ package at.hannibal2.skyhanni.features.inventory.tiarelay
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.GuiContainerEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.PlaySoundEvent
import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.CollectionUtils.sorted
import at.hannibal2.skyhanni.utils.HypixelCommands
@@ -54,18 +54,16 @@ class TiaRelayHelper {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!config.soundHelper) return
- if (event.repeatSeconds(1)) {
- if (InventoryUtils.openInventoryName().contains("Network Relay")) {
- inInventory = true
- } else {
- inInventory = false
- sounds.clear()
- resultDisplay.clear()
- }
+ if (InventoryUtils.openInventoryName().contains("Network Relay")) {
+ inInventory = true
+ } else {
+ inInventory = false
+ sounds.clear()
+ resultDisplay.clear()
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt
index 09a2c5377..7268c1925 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt
@@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.events.TabListUpdateEvent
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha
@@ -52,7 +52,7 @@ class HighlightMiningCommissionMobs {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
if (!event.repeatSeconds(2)) return
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt
index 0a23e2aaa..ca4fcc9c7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt
@@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.config.features.mining.MiningEventConfig
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.mining.eventtracker.MiningEventType.Companion.CompressFormat
import at.hannibal2.skyhanni.utils.ConfigUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -26,8 +26,7 @@ object MiningEventDisplay {
private val islandEventData: MutableMap<IslandType, MiningIslandEventInfo> = mutableMapOf()
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
- if (!event.repeatSeconds(1)) return
+ fun onSecondPassed(event: SecondPassedEvent) {
updateDisplay()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
index 9e0857285..ff6af36fb 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
@@ -9,7 +9,6 @@ import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.IslandChangeEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList
@@ -85,6 +84,18 @@ object PowderTracker {
calculateResourceHour(diamondEssenceInfo)
calculateResourceHour(goldEssenceInfo)
calculateResourceHour(chestInfo)
+
+ doublePowder = powderBossBarPattern.matcher(BossbarData.getBossbar()).find()
+ powderBossBarPattern.matchMatcher(BossbarData.getBossbar()) {
+ powderTimer = group("time")
+ doublePowder = powderTimer != "00:00"
+
+ tracker.update()
+ }
+
+ if (lastChestPicked.passedSince() > 1.minutes) {
+ isGrinding = false
+ }
}
private val tracker = SkyHanniTracker("Powder Tracker", { Data() }, { it.powderTracker })
@@ -154,23 +165,6 @@ object PowderTracker {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
- if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- doublePowder = powderBossBarPattern.matcher(BossbarData.getBossbar()).find()
- powderBossBarPattern.matchMatcher(BossbarData.getBossbar()) {
- powderTimer = group("time")
- doublePowder = powderTimer != "00:00"
-
- tracker.update()
- }
- }
- if (lastChestPicked.passedSince() > 1.minutes) {
- isGrinding = false
- }
- }
-
- @SubscribeEvent
fun onConfigLoad(event: ConfigLoadEvent) {
config.textFormat.afterChange {
tracker.update()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt
index 5edabcbb1..696e2f5c4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt
@@ -4,8 +4,8 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.config.enums.OutsideSbFeature
import at.hannibal2.skyhanni.events.ConfigLoadEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha
@@ -16,81 +16,77 @@ import net.minecraft.client.Minecraft
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-class MarkedPlayerManager {
- companion object {
+object MarkedPlayerManager {
+ val config get() = SkyHanniMod.feature.gui.markedPlayers
- val config get() = SkyHanniMod.feature.gui.markedPlayers
+ private val playerNamesToMark = mutableListOf<String>()
+ private val markedPlayers = mutableMapOf<String, EntityOtherPlayerMP>()
- val playerNamesToMark = mutableListOf<String>()
- private val markedPlayers = mutableMapOf<String, EntityOtherPlayerMP>()
-
- fun command(args: Array<String>) {
- if (args.size != 1) {
- ChatUtils.userError("Usage: /shmarkplayer <name>")
- return
- }
-
- val displayName = args[0]
- val name = displayName.lowercase()
+ fun command(args: Array<String>) {
+ if (args.size != 1) {
+ ChatUtils.userError("Usage: /shmarkplayer <name>")
+ return
+ }
+ val displayName = args[0]
+ val name = displayName.lowercase()
- if (name == LorenzUtils.getPlayerName().lowercase()) {
- ChatUtils.userError("You can't add or remove yourself this way! Go to the settings and toggle 'Mark your own name'.")
- return
- }
+ if (name == LorenzUtils.getPlayerName().lowercase()) {
+ ChatUtils.userError("You can't add or remove yourself this way! Go to the settings and toggle 'Mark your own name'.")
+ return
+ }
- if (name !in playerNamesToMark) {
- playerNamesToMark.add(name)
- findPlayers()
- ChatUtils.chat("§aMarked §eplayer §b$displayName§e!")
- } else {
- playerNamesToMark.remove(name)
- markedPlayers[name]?.let { RenderLivingEntityHelper.removeCustomRender(it) }
- markedPlayers.remove(name)
- ChatUtils.chat("§cUnmarked §eplayer §b$displayName§e!")
- }
+ if (name !in playerNamesToMark) {
+ playerNamesToMark.add(name)
+ findPlayers()
+ ChatUtils.chat("§aMarked §eplayer §b$displayName§e!")
+ } else {
+ playerNamesToMark.remove(name)
+ markedPlayers[name]?.let { RenderLivingEntityHelper.removeCustomRender(it) }
+ markedPlayers.remove(name)
+ ChatUtils.chat("§cUnmarked §eplayer §b$displayName§e!")
}
+ }
- private fun findPlayers() {
- for (entity in EntityUtils.getEntities<EntityOtherPlayerMP>()) {
- if (entity in markedPlayers.values) continue
+ private fun findPlayers() {
+ for (entity in EntityUtils.getEntities<EntityOtherPlayerMP>()) {
+ if (entity in markedPlayers.values) continue
- val name = entity.name.lowercase()
- if (name in playerNamesToMark) {
- markedPlayers[name] = entity
- entity.setColor()
- }
+ val name = entity.name.lowercase()
+ if (name in playerNamesToMark) {
+ markedPlayers[name] = entity
+ entity.setColor()
}
}
+ }
- private fun refreshColours() =
- markedPlayers.forEach {
- it.value.setColor()
- }
-
- private fun EntityOtherPlayerMP.setColor() {
- RenderLivingEntityHelper.setEntityColorWithNoHurtTime(
- this,
- config.entityColor.get().toColor().withAlpha(127),
- ::isEnabled
- )
+ private fun refreshColours() =
+ markedPlayers.forEach {
+ it.value.setColor()
}
- fun isMarkedPlayer(player: String): Boolean = player.lowercase() in playerNamesToMark
+ private fun EntityOtherPlayerMP.setColor() {
+ RenderLivingEntityHelper.setEntityColorWithNoHurtTime(
+ this,
+ config.entityColor.get().toColor().withAlpha(127),
+ ::isEnabled
+ )
+ }
- private fun isEnabled() = (LorenzUtils.inSkyBlock || OutsideSbFeature.MARKED_PLAYERS.isSelected())
- && config.highlightInWorld
+ fun isMarkedPlayer(player: String): Boolean = player.lowercase() in playerNamesToMark
- fun replaceInChat(string: String): String {
- if (!config.highlightInChat) return string
+ private fun isEnabled() = (LorenzUtils.inSkyBlock || OutsideSbFeature.MARKED_PLAYERS.isSelected())
+ && config.highlightInWorld
- val color = config.chatColor.getChatColor()
- var text = string
- for (markedPlayer in playerNamesToMark) {
- text = text.replace(markedPlayer, "$color$markedPlayer§r")
- }
- return text
+ fun replaceInChat(string: String): String {
+ if (!config.highlightInChat) return string
+
+ val color = config.chatColor.getChatColor()
+ var text = string
+ for (markedPlayer in playerNamesToMark) {
+ text = text.replace(markedPlayer, "$color$markedPlayer§r")
}
+ return text
}
@SubscribeEvent
@@ -109,12 +105,10 @@ class MarkedPlayerManager {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- findPlayers()
- }
+ findPlayers()
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt
index d4f94d6e2..a0a203879 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt
@@ -6,10 +6,10 @@ import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.PacketEvent
import at.hannibal2.skyhanni.events.ProfileJoinEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.test.command.ErrorManager
@@ -175,9 +175,8 @@ class NonGodPotEffectDisplay {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
- if (!event.repeatSeconds(1)) return
if (!ProfileStorageData.loaded) return
update()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
index fd32f9824..cb363a3a4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt
@@ -4,8 +4,8 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.events.SkyHanniRenderEntityEvent
import at.hannibal2.skyhanni.features.combat.damageindicator.BossType
import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorManager
@@ -32,12 +32,10 @@ class AshfangBlazes {
private var nearAshfang = false
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
- if (event.repeatSeconds(1)) {
- checkNearAshfang()
- }
+ checkNearAshfang()
if (nearAshfang) {
for (entity in EntityUtils.getEntities<EntityBlaze>()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
index ebd0f474d..d908df694 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt
@@ -3,8 +3,8 @@ package at.hannibal2.skyhanni.features.nether.ashfang
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.CheckRenderEntityEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.features.combat.damageindicator.BossType
import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.utils.ItemUtils.name
@@ -18,12 +18,10 @@ class AshfangHideParticles {
private var nearAshfang = false
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!LorenzUtils.inSkyBlock) return
- if (event.repeatSeconds(3)) {
- nearAshfang = DamageIndicatorManager.getDistanceTo(BossType.NETHER_ASHFANG) < 40
- }
+ nearAshfang = DamageIndicatorManager.getDistanceTo(BossType.NETHER_ASHFANG) < 40
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt
index 6e27649e7..905b5701a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt
@@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.IslandChangeEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
-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.CollectionUtils.addOrPut
@@ -73,11 +73,9 @@ object VerminTracker {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!RiftAPI.inRift()) return
- if (event.repeatSeconds(1)) {
- checkVacuum()
- }
+ checkVacuum()
}
private fun checkVacuum() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
index fe6d3e4a1..245e21100 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
@@ -11,8 +11,8 @@ import at.hannibal2.skyhanni.config.features.skillprogress.SkillProgressConfig
import at.hannibal2.skyhanni.events.ActionBarUpdateEvent
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.ProfileJoinEvent
+import at.hannibal2.skyhanni.events.SecondPassedEvent
import at.hannibal2.skyhanni.events.SkillOverflowLevelupEvent
import at.hannibal2.skyhanni.features.skillprogress.SkillUtil.XP_NEEDED_FOR_60
import at.hannibal2.skyhanni.utils.ChatUtils.chat
@@ -140,14 +140,12 @@ object SkillProgress {
}
@SubscribeEvent
- fun onTick(event: LorenzTickEvent) {
+ fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
if (lastUpdate.passedSince() > 3.seconds) showDisplay = config.alwaysShow.get()
- if (event.repeatSeconds(1)) {
- allDisplay = formatAllDisplay(drawAllDisplay())
- etaDisplay = drawETADisplay()
- }
+ allDisplay = formatAllDisplay(drawAllDisplay())
+ etaDisplay = drawETADisplay()
if (event.repeatSeconds(2)) {
update()