diff options
author | Linnea Gräf <nea@nea.moe> | 2025-04-01 01:37:55 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-04-01 01:37:55 +0200 |
commit | bda040c6c2cc77c9c1a06a61b2f13548d28d76ec (patch) | |
tree | 3c48dc96cfd74a6a7d167e45eaccca0bec74fb12 /src/main/kotlin/features/mining | |
parent | 4f4652bb0d50dfd37297a573ad73ef9cd1a8e92d (diff) | |
download | Firmament-mc1.21.5.tar.gz Firmament-mc1.21.5.tar.bz2 Firmament-mc1.21.5.zip |
WIP: Port some 1.21.5 thingsmc1.21.5
Diffstat (limited to 'src/main/kotlin/features/mining')
-rw-r--r-- | src/main/kotlin/features/mining/PickaxeAbility.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/kotlin/features/mining/PickaxeAbility.kt b/src/main/kotlin/features/mining/PickaxeAbility.kt index 1737969..2e1c59d 100644 --- a/src/main/kotlin/features/mining/PickaxeAbility.kt +++ b/src/main/kotlin/features/mining/PickaxeAbility.kt @@ -1,6 +1,7 @@ package moe.nea.firmament.features.mining import java.util.regex.Pattern +import kotlin.jvm.optionals.getOrNull import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds import net.minecraft.item.ItemStack @@ -140,8 +141,7 @@ object PickaxeAbility : FirmamentFeature { } } ?: return val extra = it.item.extraAttributes - if (!extra.contains("drill_fuel")) return - val fuel = extra.getInt("drill_fuel") + val fuel = extra.getInt("drill_fuel").getOrNull() ?: return val percentage = fuel / maxFuel.toFloat() it.barOverride = DurabilityBarEvent.DurabilityBar( lerp( |