From 7e0151569477df63601be50c82177ecfd21e5deb Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 26 Apr 2024 18:04:45 +0200 Subject: Bump to 1.20.5 --- .../moe/nea/firmament/features/mining/PickaxeAbility.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/main/kotlin/moe/nea/firmament/features/mining') 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 -- cgit