aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
index 0f83ceea8..d85136ffc 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
@@ -44,6 +44,7 @@ class GardenVisitorFeatures {
private val copperPattern = " §8\\+§c(.*) Copper".toPattern()
private val gardenExperiencePattern = " §8\\+§2(.*) §7Garden Experience".toPattern()
private val config get() = SkyHanniMod.feature.garden
+ private val logger = LorenzLogger("garden/visitors")
companion object {
var inVisitorInventory = false
@@ -171,7 +172,9 @@ class GardenVisitorFeatures {
if (config.visitorItemPreview) {
val items = GardenVisitorColorNames.visitorItems[visitor.removeColor()]
if (items == null) {
- LorenzUtils.debug("Visitor '$visitor' has no items in repo!")
+ val text = "Visitor '$visitor' has no items in repo!"
+ logger.log(text)
+ LorenzUtils.debug(text)
list.add(" §7(§c?§7)")
continue
}
@@ -378,25 +381,35 @@ class GardenVisitorFeatures {
val name = fromHypixelName(line)
// Hide hypixel watchdog entries
- if (name.contains("§c") && !name.contains("Spaceman") && !name.contains("Grandma Wolf")) continue
+ if (name.contains("§c") && !name.contains("Spaceman") && !name.contains("Grandma Wolf")) {
+ logger.log("Ignore wrong red name: '$name'")
+ continue
+ }
//hide own player name
- if (name.contains(LorenzUtils.getPlayerName())) continue
+ if (name.contains(LorenzUtils.getPlayerName())) {
+ logger.log("Ignore wrong own name: '$name'")
+ continue
+ }
visitorsInTab.add(name)
}
}
if (visitors.keys.removeIf {
val time = System.currentTimeMillis() - SBInfo.getInstance().joinedWorld
- it !in visitorsInTab && time > 2_000
+ val removed = it !in visitorsInTab && time > 2_000
+ if (removed) {
+ logger.log("Removed old visitor: $it")
+ }
+ removed
}) {
updateDisplay()
}
for (name in visitorsInTab) {
if (!visitors.containsKey(name)) {
visitors[name] = Visitor(name, status = VisitorStatus.NEW)
-// LorenzUtils.debug("new visitor '$name'")
+ logger.log("New visitor detected: $name")
if (config.visitorNotificationTitle) {
TitleUtils.sendTitle("§eNew Visitor", 5_000)
}
@@ -481,9 +494,7 @@ class GardenVisitorFeatures {
if (old == newStatus) return
visitor.status = newStatus
val name = visitor.visitorName.removeColor()
- val message = "Visitor status change for $name: $old->$newStatus ($reason)"
- println(message)
-// LorenzUtils.debug(message)
+ logger.log("Visitor status change for $name: $old->$newStatus ($reason)")
}
private fun findEntity(nameTag: EntityArmorStand, visitor: Visitor) {