Skip to content

Commit

Permalink
maybe finally fucking this time ????
Browse files Browse the repository at this point in the history
Signed-off-by: J10a1n15 <[email protected]>
  • Loading branch information
j10a1n15 committed Jan 4, 2025
1 parent bdf2d3f commit 15001a0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,7 @@ object CustomScoreboard {

@HandleEvent
fun onIslandChange(event: IslandChangeEvent) {
if (event.newIsland != IslandType.NONE) {
updateIslandEntries()

runDelayed(3.seconds) {
updateIslandEntries()
}
}
if (event.newIsland != IslandType.NONE) updateIslandEntries()
}

private fun updateIslandEntries() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package at.hannibal2.skyhanni.features.gui.customscoreboard.events

import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboardUtils.getSbLines
import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern
import at.hannibal2.skyhanni.features.nether.kuudra.KuudraAPI
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.RegexUtils.allMatches

// scoreboard
Expand All @@ -23,5 +25,5 @@ object ScoreboardEventKuudra : ScoreboardEvent() {

override val configLine = "§7(All Kuudra Lines)"

override fun showIsland() = KuudraAPI.inKuudra()
override fun showIsland() = IslandType.KUUDRA_ARENA.isInIsland()
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package at.hannibal2.skyhanni.features.nether.kuudra

import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent
import at.hannibal2.skyhanni.events.kuudra.KuudraCompleteEvent
import at.hannibal2.skyhanni.events.kuudra.KuudraEnterEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUItems.removePrefix
import at.hannibal2.skyhanni.utils.RegexUtils.firstMatcher
import at.hannibal2.skyhanni.utils.RegexUtils.matchGroup
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.RegexUtils.matches
Expand Down Expand Up @@ -61,16 +64,14 @@ object KuudraAPI {

fun inKuudra() = kuudraTier != null

@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
@HandleEvent
fun onScoreboardChange(event: ScoreboardUpdateEvent) {
if (!LorenzUtils.inSkyBlock) return
if (kuudraTier != null) return
for (line in ScoreboardData.sidebarLinesFormatted) {
tierPattern.matchMatcher(line) {
val tier = group("tier").toInt()
kuudraTier = tier
KuudraEnterEvent(tier).post()
}
tierPattern.firstMatcher(event.added) {
val tier = group("tier").toInt()
kuudraTier = tier
KuudraEnterEvent(tier).post()
}
}

Expand All @@ -81,8 +82,8 @@ object KuudraAPI {

@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
val message = event.message
completePattern.matchMatcher(message) {
if (!LorenzUtils.inSkyBlock) return
completePattern.matchMatcher(event.message) {
val tier = kuudraTier ?: return
KuudraCompleteEvent(tier).post()
}
Expand Down

0 comments on commit 15001a0

Please sign in to comment.