diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-10-07 11:43:32 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-07 02:43:32 +0200 |
commit | 24c8ce90e3925a397975b617eedf796ae52208ae (patch) | |
tree | 8ebdc6eab934f2ba6ebb5ef904212840ebfd5d3d /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 9c2df723b49cf47f9e8a76b08a90ce9874456944 (diff) | |
download | skyhanni-24c8ce90e3925a397975b617eedf796ae52208ae.tar.gz skyhanni-24c8ce90e3925a397975b617eedf796ae52208ae.tar.bz2 skyhanni-24c8ce90e3925a397975b617eedf796ae52208ae.zip |
Feature: Compact tab list (from sba but better) (#459)
Added Advanced Tab List #459
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt index e5ebc25a5..252d974ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt @@ -43,7 +43,7 @@ class TabListData { private fun readTabList(): List<String>? { val thePlayer = Minecraft.getMinecraft()?.thePlayer ?: return null val players = playerOrdering.sortedCopy(thePlayer.sendQueue.playerInfoMap) - val result: MutableList<String> = ArrayList() + val result = mutableListOf<String>() tabListGuard = true for (info in players) { val name = Minecraft.getMinecraft().ingameGUI.tabList.getPlayerName(info) @@ -53,12 +53,9 @@ class TabListData { return result.dropLast(1) } - private var ticks = 0 - @SubscribeEvent fun onTick(event: LorenzTickEvent) { - - if (ticks++ % 5 != 0) return + if (!event.isMod(5)) return val tabList = readTabList() ?: return if (cache != tabList) { |