From c86c551a1da561b609b2ace62fe94a262435ca5b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 28 May 2024 20:30:10 +0200 Subject: added error message when livid finder cant find livid --- .../skyhanni/features/dungeon/DungeonLividFinder.kt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt index 4d4bb6804..becbb896b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.EntityUtils @@ -50,13 +51,30 @@ object DungeonLividFinder { if (!config.enabled) return val dyeColor = blockLocation.getBlockStateAt().getValue(BlockStainedGlass.COLOR) - color = dyeColor.toLorenzColor() ?: error("No color found for dye color `$dyeColor`") + color = dyeColor.toLorenzColor() val color = color ?: return val chatColor = color.getChatColor() lividArmorStand = EntityUtils.getEntities() .firstOrNull { it.name.startsWith("${chatColor}﴾ ${chatColor}§lLivid") } + + if (event.isMod(20)) { + if (lividArmorStand == null) { + val amountArmorStands = EntityUtils.getEntities().filter { it.name.contains("Livid") }.count() + if (amountArmorStands >= 8) { + ErrorManager.logErrorStateWithData( + "Could not find livid", + "could not find lividArmorStand", + "dyeColor" to dyeColor, + "color" to color, + "chatColor" to chatColor, + "amountArmorStands" to amountArmorStands, + ) + } + } + } + val lividArmorStand = lividArmorStand ?: return val aabb = with(lividArmorStand) { -- cgit