diff options
Diffstat (limited to 'src/main/kotlin/dulkirmod/utils/Utils.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/utils/Utils.kt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/utils/Utils.kt b/src/main/kotlin/dulkirmod/utils/Utils.kt index fcc8de0..81646cb 100644 --- a/src/main/kotlin/dulkirmod/utils/Utils.kt +++ b/src/main/kotlin/dulkirmod/utils/Utils.kt @@ -12,6 +12,8 @@ import java.awt.datatransfer.StringSelection import java.util.* object Utils { + + var area = "" fun stripColorCodes(string: String): String { return string.replace("§.".toRegex(), "") } @@ -82,4 +84,14 @@ object Utils { fun getColorString(int: Int): String { return if (int == 16) "§z" else EnumChatFormatting.values()[int].toString() } + + fun getArea() { + val scoreboardList: List<String?> = TabListUtils.fetchTabEntires().map { + it.displayName?.unformattedText + } + for (l in scoreboardList) { + if (l != null && l.startsWith("Area: ")) + area = l.substring(6) + } + } }
\ No newline at end of file |