From 3b33e91e5ec71100b212c650ec405b349958bd4b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:20:05 +0100 Subject: Fixed Farming Contest Medal Icons in Inventory not showing. --- .../features/garden/contest/JacobFarmingContestsInventory.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt index 26c4746d1..25cfd12d7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt @@ -15,6 +15,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.drawSlotText import at.hannibal2.skyhanni.utils.RenderUtils.highlight import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.ContainerChest import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -30,7 +31,7 @@ class JacobFarmingContestsInventory { // Render the contests a tick delayed to feel smoother private var hideEverything = true - private val contestEarnedPattern = "§7You earned a §(?.*)§l.* §7medal!".toPattern() + private val medalPattern = "§7§7You placed in the (?.*)".toPattern() @SubscribeEvent fun onInventoryClose(event: InventoryCloseEvent) { @@ -122,16 +123,16 @@ class JacobFarmingContestsInventory { for (line in stack.getLore()) { if (line.contains("Contest boosted by Finnegan!")) finneganContest = true - val color = contestEarnedPattern.matchMatcher(line) { group("medalColour") } ?: continue - val medalEarned = ContestBracket.entries.find { it.color == color } ?: return + val name = medalPattern.matchMatcher(line) { group("medal").removeColor() } ?: continue + val medal = LorenzUtils.enumValueOfOrNull(name) ?: return - var stackTip = "§${medalEarned.color}✦" + var stackTip = "§${medal.color}✦" var x = event.x + 9 var y = event.y + 1 var scale = .7f if (finneganContest && config.finneganIcon) { - stackTip = "§${medalEarned.color}▲" + stackTip = "§${medal.color}▲" x = event.x + 5 y = event.y - 2 scale = 1.3f -- cgit