From 56f025f49bf1a052fe41a29f0e03c9244d04f9fa Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 23 Sep 2024 21:34:02 +0200 Subject: [PATCH] Update Pickonimbus 2000 max durability --- .../features/impl/misc/ItemFeatures.kt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt index 47ef54e58..873327818 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt @@ -83,6 +83,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.lwjgl.input.Keyboard import java.awt.Color +import kotlin.math.min import kotlin.math.pow object ItemFeatures { @@ -653,11 +654,19 @@ object ItemFeatures { stackTip = ItemUtil.getStarCount(extraAttributes).toString() } if (extraAttributes.hasKey("pickonimbus_durability")) { - RenderUtil.drawDurabilityBar( - event.x, - event.y, - 1 - extraAttributes.getInteger("pickonimbus_durability") / 5000.0 - ) + val durability = extraAttributes.getInteger("pickonimbus_durability") + /* + Old Pickonimbuses had 5000 durability. If they were at full durability, they were nerfed to 2000. + However, if they were not at full durability, they were left alone. Therefore, it's not really + possible to check the true max durability, so we just clamp any durability above 2000 to 2000. + */ + if (durability < 2000) { + RenderUtil.drawDurabilityBar( + event.x, + event.y, + 1 - min(durability, 2000) / 2000.0 + ) + } } if (Skytils.config.showAttributeShardAbbreviation && itemId == "ATTRIBUTE_SHARD" && extraAttributes.getCompoundTag( "attributes"