Skip to content

Commit

Permalink
@CalMWolfs comments
Browse files Browse the repository at this point in the history
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <[email protected]>
  • Loading branch information
RayDeeUx committed Jan 18, 2024
1 parent 1004969 commit 897f16a
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class CrystalHollowsLobbyAgeWarning {
private fun getLobbyAgeInMinecraftDays(): Long = (mc.theWorld.worldTime) / TICKS_PER_MC_DAY //world day changes at 6AM in skyblock time

private fun processPlayerCount() {
if (!isInCrystalHollows()) return
for (line in TabListData.getTabList()) {
playerCountTabListPattern.matchMatcher(line) {
val playerCount = group("playerCount").formatNumber()
Expand All @@ -57,7 +56,6 @@ class CrystalHollowsLobbyAgeWarning {
}

private fun processLobbyAge() {
if (!isInCrystalHollows()) return
val lobbyAge = getLobbyAgeInMinecraftDays()
if (oldLobbyAge == lobbyAge) return
oldLobbyAge = lobbyAge
Expand All @@ -70,15 +68,13 @@ class CrystalHollowsLobbyAgeWarning {

@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!isEnabled()) return
if (!event.repeatSeconds(1)) return
processLobbyAge()
}

@SubscribeEvent
fun onTabListUpdate(event: TabListUpdateEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!isEnabled()) return
processPlayerCount()
}
Expand All @@ -101,5 +97,4 @@ class CrystalHollowsLobbyAgeWarning {
}

private fun isEnabled() = THE_CRYSTAL_HOLLOWS.isInIsland() && config.enabled
private fun isInCrystalHollows() = THE_CRYSTAL_HOLLOWS.isInIsland()
}

0 comments on commit 897f16a

Please sign in to comment.