From b7643347ee38a8e376804e148e9d02d1c4b37b46 Mon Sep 17 00:00:00 2001 From: ronald Date: Sun, 30 Jul 2023 12:45:32 -0500 Subject: added visitor alert --- src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt') diff --git a/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt b/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt index 881b3b9..b69f0b4 100644 --- a/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt +++ b/src/main/kotlin/com/dulkirfabric/util/TablistUtils.kt @@ -1,6 +1,7 @@ package com.dulkirfabric.util import com.dulkirfabric.DulkirModFabric.mc +import com.dulkirfabric.events.AreaChangeEvent import com.dulkirfabric.events.LongUpdateEvent import meteordevelopment.orbit.EventHandler import net.minecraft.client.network.PlayerListEntry @@ -35,7 +36,10 @@ object TablistUtils { tablist!!.forEach { val str = it.displayName?.string?.trim() ?: return@forEach areaPattern.find(str)?.let { result -> - persistentInfo.area = result.groupValues[1] + if (persistentInfo.area != result.groupValues[1]) { + AreaChangeEvent(result.groupValues[1], persistentInfo.area).post() + persistentInfo.area = result.groupValues[1] + } return@forEach } -- cgit