From 1a2abbef994d493d9e7d3c8dc421dc5b2f47e342 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 18 Jan 2024 21:16:05 +0100 Subject: adding visitor status to /shdebug --- .../garden/visitor/GardenVisitorFeatures.kt | 38 ++++++++++++++++++++++ .../skyhanni/features/garden/visitor/VisitorAPI.kt | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) (limited to 'src/main') 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 1c17d38f6..6a9ef7c8c 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 @@ -5,6 +5,8 @@ import at.hannibal2.skyhanni.config.features.garden.visitor.VisitorConfig.Highli import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.data.SackStatus +import at.hannibal2.skyhanni.events.BurrowGuessEvent +import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -604,6 +606,42 @@ class GardenVisitorFeatures { } } + @SubscribeEvent + fun onBurrowGuess(event: BurrowGuessEvent) { + LorenzUtils.chat("gues the burrow!!") + } + + @SubscribeEvent + fun onDebugDataCollect(event: DebugDataCollectEvent) { + event.title("Garden Visitor Stats") + + if (!GardenAPI.inGarden()) { + event.ignore("not in garden") + return + } + + event.addData { + val visitors = VisitorAPI.visitors + + add("visitors: ${visitors.size}") + + for (visitor in visitors.values) { + add(" ") + add("visitorName: '${visitor.visitorName}'") + add("status: '${visitor.status}'") + if (visitor.inSacks) { + add("inSacks!") + } + if (visitor.shoppingList.isNotEmpty()) { + add("shoppingList: '${visitor.shoppingList}'") + } + visitor.offer?.offerItem?.getInternalName()?.let { + add("offer: '${it}'") + } + } + } + } + @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.visitorNeedsDisplay", "garden.visitors.needs.display") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt index c3c832d78..4d892528a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt @@ -16,7 +16,7 @@ import at.hannibal2.skyhanni.utils.NEUInternalName import net.minecraft.item.ItemStack object VisitorAPI { - private var visitors = mapOf() + var visitors = mapOf() var inInventory = false val config get() = GardenAPI.config.visitors private val logger = LorenzLogger("garden/visitors/api") -- cgit