aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-15 17:20:05 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-15 17:20:05 +0100
commit3b33e91e5ec71100b212c650ec405b349958bd4b (patch)
treea54b0dec382bec06d20ea99f9daa098a19af1b6e /src
parent374695f99fcac8eb773b5a98e5540d75e7d8739a (diff)
downloadskyhanni-3b33e91e5ec71100b212c650ec405b349958bd4b.tar.gz
skyhanni-3b33e91e5ec71100b212c650ec405b349958bd4b.tar.bz2
skyhanni-3b33e91e5ec71100b212c650ec405b349958bd4b.zip
Fixed Farming Contest Medal Icons in Inventory not showing.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt11
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