From 360234fa2299ce22ef8aeb5f3c2c4f9de1bce26c Mon Sep 17 00:00:00 2001 From: calmwolfs Date: Mon, 1 Jan 2024 22:26:23 -0500 Subject: [PATCH] migrate TeleportPadCompactName --- .../misc/teleportpad/TeleportPadCompactName.kt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt index 73c2e3398b63..e4f113f44684 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.RenderLivingEvent @@ -11,9 +12,15 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class TeleportPadCompactName { - // TODO USE SH-REPO - private val patternName = "§.✦ §aWarp To (?.*)".toPattern() - private val patternNoName = "§.✦ §cNo Destination".toPattern() + private val patternGroup = RepoPattern.group("misc.teleportpad") + private val patternName by patternGroup.pattern( + "name", + "§.✦ §aWarp To (?.*)" + ) + private val patternNoName by patternGroup.pattern( + "noname", + "§.✦ §cNo Destination" + ) @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLivingB(event: RenderLivingEvent.Specials.Pre) { @@ -32,4 +39,4 @@ class TeleportPadCompactName { entity.customNameTag = group("name") } } -} \ No newline at end of file +}