aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-12 22:14:49 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-12 22:14:49 +0100
commit3ac5c34273342af62f44bd656e50d5d6ecb1c304 (patch)
treeb71e8716ae06f65fe1794509c5aec36d64b21837 /src
parent3308bb6df337cf0de2ffc3c653a2d8a281354f0f (diff)
downloadFirmament-3ac5c34273342af62f44bd656e50d5d6ecb1c304.tar.gz
Firmament-3ac5c34273342af62f44bd656e50d5d6ecb1c304.tar.bz2
Firmament-3ac5c34273342af62f44bd656e50d5d6ecb1c304.zip
fix: Re-add extra item tooltips to the item list
Diffstat (limited to 'src')
-rw-r--r--src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt9
-rw-r--r--src/main/kotlin/events/TooltipEvent.kt17
2 files changed, 8 insertions, 18 deletions
diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt
index de173ff..a708c5b 100644
--- a/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt
+++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt
@@ -27,7 +27,9 @@ import net.minecraft.client.render.VertexConsumerProvider
import net.minecraft.client.render.model.BakedModel
import net.minecraft.client.texture.SpriteAtlasTexture
import net.minecraft.item.ModelTransformationMode
+import net.minecraft.item.tooltip.TooltipType
import moe.nea.firmament.compat.rei.FirmamentReiPlugin.Companion.asItemEntry
+import moe.nea.firmament.events.ItemTooltipEvent
import moe.nea.firmament.repo.SBItemStack
import moe.nea.firmament.util.MC
import moe.nea.firmament.util.mc.displayNameAccordingToNbt
@@ -52,7 +54,12 @@ object NEUItemEntryRenderer : EntryRenderer<SBItemStack>, BatchedEntryRenderer<S
val lore = mutableListOf(stack.displayNameAccordingToNbt)
lore.addAll(stack.loreAccordingToNbt)
-
+ ItemTooltipEvent.publish(ItemTooltipEvent(
+ stack,
+ tooltipContext.vanillaContext(),
+ TooltipType.BASIC,
+ lore
+ ))
// TODO: tags aren't sent as early now so some tooltip components that use tags will crash the game
// stack.getTooltip(
// Item.TooltipContext.create(
diff --git a/src/main/kotlin/events/TooltipEvent.kt b/src/main/kotlin/events/TooltipEvent.kt
deleted file mode 100644
index 630ba56..0000000
--- a/src/main/kotlin/events/TooltipEvent.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-package moe.nea.firmament.events
-
-import net.minecraft.client.gui.tooltip.Tooltip
-import net.minecraft.entity.player.PlayerEntity
-import net.minecraft.item.Item
-import net.minecraft.item.ItemStack
-
-data class TooltipEvent(
- val itemStack: ItemStack,
- val tooltip: Tooltip,
- val tooltipContext: Item.TooltipContext,
- val player: PlayerEntity?
-) : FirmamentEvent() {
- companion object : FirmamentEventBus<TooltipEvent>()
-}