Skip to content

Commit

Permalink
Update Pickonimbus 2000 max durability
Browse files Browse the repository at this point in the history
  • Loading branch information
qtlunya committed Sep 23, 2024
1 parent ddb3851 commit 56f025f
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 56f025f

Please sign in to comment.