diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-01-08 10:57:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 16:57:56 +0100 |
commit | a4c42054306a5c5ec6e3daeb2ff98e9c816b0b9a (patch) | |
tree | 86fb52cc45bb3e973a76d0e43a7d2f306cbb7844 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 8559bcec78048bdabd0e19bbeead4218930201be (diff) | |
download | skyhanni-a4c42054306a5c5ec6e3daeb2ff98e9c816b0b9a.tar.gz skyhanni-a4c42054306a5c5ec6e3daeb2ff98e9c816b0b9a.tar.bz2 skyhanni-a4c42054306a5c5ec6e3daeb2ff98e9c816b0b9a.zip |
option to hide pet candy count on max + fix pet lvl regex (#857)
Added option to hide pet candy count on maxed out pets. #857
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 82a6b076f..2d97c0564 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import com.google.gson.JsonObject import net.minecraft.item.Item import net.minecraft.item.ItemStack @@ -17,8 +18,7 @@ import java.util.Locale object SkyBlockItemModifierUtils { private val drillPartTypes = listOf("drill_part_upgrade_module", "drill_part_engine", "drill_part_fuel_tank") - // TODO USE SH-REPO - private val petLevelPattern = "§7\\[Lvl (?<level>.*)\\] .*".toPattern() + private val petLevelPattern by RepoPattern.pattern("utils.item.petlevel", "(?:§f§f)?§7\\[Lvl (?<level>\\d+)] .*") fun ItemStack.getHotPotatoCount() = getAttributeInt("hot_potato_count") @@ -100,6 +100,8 @@ object SkyBlockItemModifierUtils { return 0 } + fun ItemStack.getMaxPetLevel() = if (this.getInternalName() == "GOLDEN_DRAGON;4".asInternalName()) 200 else 100 + fun ItemStack.getDrillUpgrades() = getExtraAttributes()?.let { val list = mutableListOf<NEUInternalName>() for (attributes in it.keySet) { |