diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt | 11 |
1 files changed, 6 insertions, 5 deletions
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 §(?<medalColour>.*)§l.* §7medal!".toPattern() + private val medalPattern = "§7§7You placed in the (?<medal>.*)".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<ContestBracket>(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 |