Update deprecated method usage

This commit is contained in:
DBotThePony 2025-01-19 01:50:37 +07:00
parent e53a7f65d8
commit 78896089ec
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -44,7 +44,7 @@ open class FluidGaugePanel<out S : Screen>(
protected open fun makeTooltip(): MutableList<Component> {
val tooltip = mutableListOf<Component>(
if (widget.fluid.isEmpty) TranslatableComponent("otm.gui.empty") else TextComponent(String.format("%s: %.2f%%", widget.fluid.displayName.string, widget.percentage * 100.0)),
if (widget.fluid.isEmpty) TranslatableComponent("otm.gui.empty") else TextComponent(String.format("%s: %.2f%%", widget.fluid.hoverName.string, widget.percentage * 100.0)),
formatFluidLevel(if (widget.fluid.isEmpty) 0 else widget.fluid.amount, widget.maxCapacity, formatAsReadable = ShiftPressedCond)
)
@ -67,7 +67,7 @@ open class FluidGaugePanel<out S : Screen>(
override fun innerRender(graphics: MGUIGraphics, mouseX: Float, mouseY: Float, partialTick: Float) {
if (widget.percentage > 0.01f && widget.fluid.isNotEmpty) {
val data = IClientFluidTypeExtensions.of(widget.fluid.fluid)
val texture = data.stillTexture!!
val texture = data.stillTexture
val sprite = minecraft.getTextureAtlas(InventoryMenu.BLOCK_ATLAS).apply(texture)!!
val tint = RGBAColor.argb(data.getTintColor(widget.fluid))
var height = (height * widget.percentage) / 16f