diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-26 18:04:45 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-04-26 18:15:54 +0200 |
commit | 7e0151569477df63601be50c82177ecfd21e5deb (patch) | |
tree | f30e5440a1855de92d2b424ef79339d3d6cf5f34 /src/main/kotlin/moe/nea/firmament/gui/WTitledItem.kt | |
parent | 041da7c7d179df01c4048a81ddf40a9f13c3ce77 (diff) | |
download | firmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.gz firmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.bz2 firmament-7e0151569477df63601be50c82177ecfd21e5deb.zip |
Bump to 1.20.5
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/WTitledItem.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/WTitledItem.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/WTitledItem.kt b/src/main/kotlin/moe/nea/firmament/gui/WTitledItem.kt index 817c099..a1d4d68 100644 --- a/src/main/kotlin/moe/nea/firmament/gui/WTitledItem.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/WTitledItem.kt @@ -1,5 +1,6 @@ /* * SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe> + * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe> * * SPDX-License-Identifier: GPL-3.0-or-later */ @@ -11,13 +12,13 @@ import io.github.cottonmc.cotton.gui.client.BackgroundPainter import io.github.cottonmc.cotton.gui.widget.TooltipBuilder import io.github.cottonmc.cotton.gui.widget.WWidget import net.minecraft.client.gui.DrawContext -import net.minecraft.client.item.TooltipContext +import net.minecraft.client.item.TooltipType import net.minecraft.item.ItemStack import net.minecraft.text.Text import moe.nea.firmament.util.MC open class WTitledItem(var stack: ItemStack, val countString: Text = Text.empty()) : WWidget() { - var backgroundPainter:BackgroundPainter = BackgroundPainter.SLOT + var backgroundPainter: BackgroundPainter = BackgroundPainter.SLOT override fun canResize(): Boolean = true override fun paint(context: DrawContext, x: Int, y: Int, mouseX: Int, mouseY: Int) { backgroundPainter.paintBackground(context, x, y, this) @@ -32,7 +33,7 @@ open class WTitledItem(var stack: ItemStack, val countString: Text = Text.empty( } override fun addTooltip(tooltip: TooltipBuilder) { - tooltip.add(*stack.getTooltip(null, TooltipContext.BASIC).toTypedArray()) + tooltip.add(*stack.getTooltip(null, null, TooltipType.BASIC).toTypedArray()) } } |