diff options
author | Walker Selby <git@walkerselby.com> | 2023-12-04 07:09:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 16:09:38 +0100 |
commit | 5a8d02dcd10015f310bab9d18558d2299c856dd1 (patch) | |
tree | 00ed1b7cc677dc8f38b540ea80424166752c5fc8 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | a0b37ef8029ff0aecf890447e62e92bf2c28c304 (diff) | |
download | skyhanni-5a8d02dcd10015f310bab9d18558d2299c856dd1.tar.gz skyhanni-5a8d02dcd10015f310bab9d18558d2299c856dd1.tar.bz2 skyhanni-5a8d02dcd10015f310bab9d18558d2299c856dd1.zip |
Fix: Fix Poison Candy I Compact Potion & Cleanup (#758)
changed CompactSplashPotionMessage, added compact potion message support for splash messages and for Poisoned Candy I. #758
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 7f5759a70..b468bc33d 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -35,6 +35,7 @@ import java.text.SimpleDateFormat import java.util.Collections import java.util.Timer import java.util.TimerTask +import java.util.regex.Matcher import kotlin.properties.ReadWriteProperty import kotlin.reflect.KMutableProperty1 import kotlin.reflect.KProperty @@ -637,4 +638,12 @@ object LorenzUtils { } FMLCommonHandler.instance().handleExit(-1) } + + /** + * Get the group, otherwise, return null + * @param groupName The group name in the pattern + */ + fun Matcher.groupOrNull(groupName: String): String? { + return runCatching { this.group(groupName) }.getOrNull() + } } |