diff options
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/pests/SprayFeatures.kt | 9 |
1 files changed, 5 insertions, 4 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 f31e4e3a3..96e2de239 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 @@ -15,19 +15,20 @@ class SprayFeatures { private var display: String? = null private var lastChangeTime = SimpleTimeMark.farPast() + // TODO repo + private val pattern = "§a§lSPRAYONATOR! §r§7Your selected material is now §r§a(?<spray>.*)§r§7!".toPattern() + @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!config.pestWhenSelector) return - val pattern = "§a§lSPRAYONATOR! §r§7Your selected material is now §r§a(?<spray>.*)§r§7!".toPattern() - val type = pattern.matchMatcher(event.message) { val sprayName = group("spray") SprayType.getByName(sprayName) ?: error("unknown spray: '$sprayName'") } ?: return - val pests = type.getPests().joinToString("§7, ", prefix = "§6") { it.displayName } - display = "§a${type.displayName} §7($pests§7)" + val pests = type.getPests().joinToString("§7, §6") { it.displayName } + display = "§a${type.displayName} §7(§6$pests§7)" lastChangeTime = SimpleTimeMark.now() |