diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-18 21:16:05 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-18 21:16:05 +0100 |
commit | 1a2abbef994d493d9e7d3c8dc421dc5b2f47e342 (patch) | |
tree | 2412ad504b929063dae6d4072328dbb6eda421e2 | |
parent | 41df011a8b1892ac69a8903949fddc1b6bcc913c (diff) | |
download | skyhanni-1a2abbef994d493d9e7d3c8dc421dc5b2f47e342.tar.gz skyhanni-1a2abbef994d493d9e7d3c8dc421dc5b2f47e342.tar.bz2 skyhanni-1a2abbef994d493d9e7d3c8dc421dc5b2f47e342.zip |
adding visitor status to /shdebug
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 38 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt | 2 |
2 files changed, 39 insertions, 1 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 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 @@ -605,6 +607,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") event.move(3, "garden.visitorNeedsPos", "garden.visitors.needs.pos") 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<String, Visitor>() + var visitors = mapOf<String, Visitor>() var inInventory = false val config get() = GardenAPI.config.visitors private val logger = LorenzLogger("garden/visitors/api") |