diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayFeatures.kt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayFeatures.kt index 96e2de239..9a25a67ce 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayFeatures.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.garden.pests import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.garden.pests.PestAPI.getPests +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -23,8 +24,15 @@ class SprayFeatures { if (!config.pestWhenSelector) return val type = pattern.matchMatcher(event.message) { - val sprayName = group("spray") - SprayType.getByName(sprayName) ?: error("unknown spray: '$sprayName'") + val sprayName = group("spray") + "d" + SprayType.getByName(sprayName) ?: run { + ErrorManager.logErrorStateWithData( + "Error reading spray material", "SprayType is null", + "sprayName" to sprayName, + "event.message" to event.message, + ) + return + } } ?: return val pests = type.getPests().joinToString("§7, §6") { it.displayName } |