From 90d24f8dd01f87fa7dbdf49a150314c887cb5bf9 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Wed, 24 Apr 2024 00:38:04 +0200 Subject: Backend: Tooltip Event without forge (#1331) --- .../java/at/hannibal2/skyhanni/events/LorenzToolTipEvent.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/events') diff --git a/src/main/java/at/hannibal2/skyhanni/events/LorenzToolTipEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/LorenzToolTipEvent.kt index 52a6dc1d7..1a987e6f9 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/LorenzToolTipEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/LorenzToolTipEvent.kt @@ -2,8 +2,18 @@ package at.hannibal2.skyhanni.events import net.minecraft.inventory.Slot import net.minecraft.item.ItemStack +import net.minecraftforge.fml.common.eventhandler.Cancelable -class LorenzToolTipEvent(val slot: Slot, val itemStack: ItemStack, var toolTip: MutableList) : LorenzEvent() { +@Cancelable +class LorenzToolTipEvent(val slot: Slot, val itemStack: ItemStack, private val toolTip0: MutableList) : + LorenzEvent() { + + var toolTip + set(value) { + toolTip0.clear() + toolTip0.addAll(value) + } + get() = toolTip0 fun toolTipRemovedPrefix() = toolTip.map { it.removePrefix("§5§o") } } -- cgit