diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-01-31 08:26:32 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-30 22:26:32 +0100 |
commit | aa824493ab33aa4386eeb7fdf17c272af5c3bc63 (patch) | |
tree | e542b7c3457f70a65e91680265e1adf54a7c18dc /src/main/java/at/hannibal2/skyhanni/data | |
parent | f17ac28f0531d0f1f3c787ba93a3944f8ad52bfb (diff) | |
download | skyhanni-aa824493ab33aa4386eeb7fdf17c272af5c3bc63.tar.gz skyhanni-aa824493ab33aa4386eeb7fdf17c272af5c3bc63.tar.bz2 skyhanni-aa824493ab33aa4386eeb7fdf17c272af5c3bc63.zip |
Fix & Backend: fix rep helper sacks also convert rep helper to use NEUInternalName (#963)
Using NEUInternalName in Reputation Helper Quest. Removed Quest Item Helper. Fixed Reputation Helper in Crimson Isle showing correct sack amount. #963
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt | 22 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/CrimsonIsleReputationJson.java | 3 |
2 files changed, 17 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt index 454074d3d..fe6dc189d 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt @@ -24,6 +24,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matches import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import com.google.gson.annotations.Expose import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -35,12 +36,19 @@ object SackAPI { var inSackInventory = false - // TODO USE SH-REPO - private val sackPattern = "^(.* Sack|Enchanted .* Sack)$".toPattern() - private val numPattern = - "(?:(?:§[0-9a-f](?<level>I{1,3})§7:)?|(?:§7Stored:)?) (?<color>§[0-9a-f])(?<stored>[0-9.,kKmMbB]+)§7/(?<total>\\d+(?:[0-9.,]+)?[kKmMbB]?)".toPattern() - private val gemstonePattern = - " §[0-9a-f](?<gemrarity>[A-z]*): §[0-9a-f](?<stored>\\d+(?:\\.\\d+)?(?:(?:,\\d+)?)+[kKmM]?)(?: §[0-9a-f]\\(\\d+(?:\\.\\d+)?(?:(?:,\\d+)?)+[kKmM]?\\))?".toPattern() + private val patternGroup = RepoPattern.group("data.sacks") + private val sackPattern by patternGroup.pattern( + "sack", + "^(.* Sack|Enchanted .* Sack)\$" + ) + private val numPattern by patternGroup.pattern( + "number", + "(?:(?:§[0-9a-f](?<level>I{1,3})§7:)?|(?:§7Stored:)?) (?<color>§[0-9a-f])(?<stored>[0-9.,kKmMbB]+)§7/(?<total>\\d+(?:[0-9.,]+)?[kKmMbB]?)" + ) + private val gemstonePattern by patternGroup.pattern( + "gemstone", + " §[0-9a-f](?<gemrarity>[A-z]*): §[0-9a-f](?<stored>\\d+(?:\\.\\d+)?(?:(?:,\\d+)?)+[kKmM]?)(?: §[0-9a-f]\\(\\d+(?:\\.\\d+)?(?:(?:,\\d+)?)+[kKmM]?\\))?" + ) private var isRuneSack = false private var isGemstoneSack = false @@ -286,7 +294,7 @@ object SackAPI { return sackData[item] ?: return SackItem(0, 0, SackStatus.MISSING) } - sackData = sackData.editCopy { this[item] = SackItem(0, 0, SackStatus.OUTDATED) } + sackData = sackData.editCopy { this[item] = SackItem(0, 0, SackStatus.MISSING) } return sackData[item] ?: return SackItem(0, 0, SackStatus.MISSING) } diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/CrimsonIsleReputationJson.java b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/CrimsonIsleReputationJson.java index f349aef9a..0ab0e52ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/CrimsonIsleReputationJson.java +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/CrimsonIsleReputationJson.java @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data.jsonobjects.repo; +import at.hannibal2.skyhanni.utils.NEUInternalName; import com.google.gson.annotations.Expose; import java.util.List; @@ -26,7 +27,7 @@ public class CrimsonIsleReputationJson { public static class ReputationQuest { @Expose - public String item; + public NEUInternalName item; @Expose public List<Double> location; |