aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-10-26 12:51:44 +0100
committerGitHub <noreply@github.com>2023-10-26 13:51:44 +0200
commit075368eb9d19578950fdb727bf2f195c63f41f3c (patch)
treea9f44aedbb32aa6805827d6d86766056cacf8ad2 /src/main/java/at/hannibal2/skyhanni/utils
parent7b6d04e280a55edc7aed23f7d34c3ad19cb48687 (diff)
downloadskyhanni-075368eb9d19578950fdb727bf2f195c63f41f3c.tar.gz
skyhanni-075368eb9d19578950fdb727bf2f195c63f41f3c.tar.bz2
skyhanni-075368eb9d19578950fdb727bf2f195c63f41f3c.zip
Add Repo TODOs (#585)
Add Repo TODOs #585
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt1
4 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 506f557b7..f98a3a23a 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -241,6 +241,7 @@ object ItemUtils {
fun isSkyBlockMenuItem(stack: ItemStack?): Boolean = stack?.getInternalName()?.equals("SKYBLOCK_MENU") ?: false
+ // TODO USE SH-REPO
private val patternInFront = "(?: *§8(\\+§[\\d\\w])?(?<amount>[\\d\\.km,]+)(x )?)?(?<name>.*)".toPattern()
private val patternBehind = "(?<name>(?:['\\w-]+ ?)+)(?:§8x(?<amount>[\\d,]+))?".toPattern()
@@ -311,4 +312,4 @@ object ItemUtils {
}
return rarity
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index f73fbcdb4..641cd692e 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -112,13 +112,15 @@ object NEUItems {
return internalName
}
+ // Workaround for duplex
+ private val duplexPattern = "ULTIMATE_DUPLEX;(?<tier>.*)".toPattern()
+
private fun fixEnchantmentName(originalName: String): NEUInternalName {
- // Workaround for duplex
- "ULTIMATE_DUPLEX;(?<tier>.*)".toPattern().matchMatcher(originalName) {
+ duplexPattern.matchMatcher(originalName) {
val tier = group("tier")
return "ULTIMATE_REITERATE;$tier".asInternalName()
}
-
+ // TODO USE SH-REPO
return originalName.asInternalName()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index fa94cb21d..7f6cc7623 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -16,6 +16,8 @@ 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()
fun ItemStack.getHotPotatoCount() = getAttributeInt("hot_potato_count")
@@ -303,4 +305,4 @@ object SkyBlockItemModifierUtils {
}.findFirst().get().colorCode
}
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index 802decbce..66eb0faad 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -15,6 +15,7 @@ import java.util.regex.Matcher
import java.util.regex.Pattern
object StringUtils {
+ // TODO USE SH-REPO
private val playerChatPattern = "(?<important>.*?)(?:§[f7r])*: .*".toPattern()
private val chatUsernamePattern = "^(?:§\\w\\[§\\w\\d+§\\w] )?(?:(?:§\\w)+\\S )?(?<rankedName>(?:§\\w\\[\\w.+] )?(?:§\\w)?(?<username>\\w+))(?: (?:§\\w)?\\[.+?])?".toPattern()
private val whiteSpaceResetPattern = "^(?:\\s|§r)*|(?:\\s|§r)*$".toPattern()