aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/features/mining
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-04-26 18:04:45 +0200
committerLinnea Gräf <nea@nea.moe>2024-04-26 18:15:54 +0200
commit7e0151569477df63601be50c82177ecfd21e5deb (patch)
treef30e5440a1855de92d2b424ef79339d3d6cf5f34 /src/main/kotlin/moe/nea/firmament/features/mining
parent041da7c7d179df01c4048a81ddf40a9f13c3ce77 (diff)
downloadfirmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.gz
firmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.bz2
firmament-7e0151569477df63601be50c82177ecfd21e5deb.zip
Bump to 1.20.5
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/features/mining')
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt b/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt
index 24a39e0..956ffc3 100644
--- a/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/mining/PickaxeAbility.kt
@@ -91,11 +91,9 @@ object PickaxeAbility : FirmamentFeature {
DurabilityBarEvent.subscribe {
if (!TConfig.drillFuelBar) return@subscribe
val lore = it.item.loreAccordingToNbt
- if (lore.lastOrNull()?.value?.unformattedString?.contains("DRILL") != true) return@subscribe
+ if (lore.lastOrNull()?.unformattedString?.contains("DRILL") != true) return@subscribe
val maxFuel = lore.firstNotNullOfOrNull {
- fuelPattern.useMatch(
- it.value?.unformattedString ?: return@firstNotNullOfOrNull null
- ) {
+ fuelPattern.useMatch(it.unformattedString) {
parseShortNumber(group("maxFuel"))
}
} ?: return@subscribe
@@ -115,7 +113,7 @@ object PickaxeAbility : FirmamentFeature {
if (MC.screen?.title?.unformattedString == "Heart of the Mountain") {
val name = it.stack.displayNameAccordingToNbt?.unformattedString ?: return@subscribe
val cooldown = it.stack.loreAccordingToNbt.firstNotNullOfOrNull {
- cooldownPattern.useMatch(it.value?.unformattedString ?: return@firstNotNullOfOrNull null) {
+ cooldownPattern.useMatch(it.unformattedString) {
parseTimePattern(group("cooldown"))
}
} ?: return@subscribe
@@ -134,15 +132,15 @@ object PickaxeAbility : FirmamentFeature {
fun getCooldownFromLore(itemStack: ItemStack): PickaxeAbilityData? {
val lore = itemStack.loreAccordingToNbt
- if (!lore.any { it.value?.unformattedString?.contains("Breaking Power") == true })
+ if (!lore.any { it.unformattedString.contains("Breaking Power") == true })
return null
val cooldown = lore.firstNotNullOfOrNull {
- cooldownPattern.useMatch(it.value?.unformattedString ?: return@firstNotNullOfOrNull null) {
+ cooldownPattern.useMatch(it.unformattedString) {
parseTimePattern(group("cooldown"))
}
} ?: return null
val name = lore.firstNotNullOfOrNull {
- abilityPattern.useMatch(it.value?.unformattedString ?: return@firstNotNullOfOrNull null) {
+ abilityPattern.useMatch(it.unformattedString) {
group("name")
}
} ?: return null