diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-28 20:30:10 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-05-28 20:30:10 +0200 |
commit | c86c551a1da561b609b2ace62fe94a262435ca5b (patch) | |
tree | 46669e29f15c68ab8ee99ff58e737eb92057dc72 | |
parent | 88fc5b7514a69f8b8fc05d7b74104e2036b00c89 (diff) | |
download | skyhanni-c86c551a1da561b609b2ace62fe94a262435ca5b.tar.gz skyhanni-c86c551a1da561b609b2ace62fe94a262435ca5b.tar.bz2 skyhanni-c86c551a1da561b609b2ace62fe94a262435ca5b.zip |
added error message when livid finder cant find livid
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt | 20 |
1 files changed, 19 insertions, 1 deletions
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<EntityArmorStand>() .firstOrNull { it.name.startsWith("${chatColor}﴾ ${chatColor}§lLivid") } + + if (event.isMod(20)) { + if (lividArmorStand == null) { + val amountArmorStands = EntityUtils.getEntities<EntityArmorStand>().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) { |