aboutsummaryrefslogtreecommitdiff
path: root/src/compat
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-08 22:02:10 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-08 22:02:10 +0100
commit0e1ddd2c913656a631e26dd0c560f25179a7dc2d (patch)
tree4b4ed01165aa51c23115333dec20075473f4e8c6 /src/compat
parentf6f8fef556e74f24187ad2a6296f573024a378b3 (diff)
downloadFirmament-update.tar.gz
Firmament-update.tar.bz2
Firmament-update.zip
Fix missing tags in REI renderingupdate
Diffstat (limited to 'src/compat')
-rw-r--r--src/compat/rei/java/moe/nea/firmament/compat/rei/NEUItemEntryRenderer.kt22
1 files changed, 15 insertions, 7 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 da0b645..de173ff 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
@@ -26,12 +26,12 @@ import net.minecraft.client.render.OverlayTexture
import net.minecraft.client.render.VertexConsumerProvider
import net.minecraft.client.render.model.BakedModel
import net.minecraft.client.texture.SpriteAtlasTexture
-import net.minecraft.item.Item
import net.minecraft.item.ModelTransformationMode
-import net.minecraft.item.tooltip.TooltipType
import moe.nea.firmament.compat.rei.FirmamentReiPlugin.Companion.asItemEntry
import moe.nea.firmament.repo.SBItemStack
import moe.nea.firmament.util.MC
+import moe.nea.firmament.util.mc.displayNameAccordingToNbt
+import moe.nea.firmament.util.mc.loreAccordingToNbt
object NEUItemEntryRenderer : EntryRenderer<SBItemStack>, BatchedEntryRenderer<SBItemStack, BakedModel> {
override fun render(
@@ -49,11 +49,19 @@ object NEUItemEntryRenderer : EntryRenderer<SBItemStack>, BatchedEntryRenderer<S
override fun getTooltip(entry: EntryStack<SBItemStack>, tooltipContext: TooltipContext): Tooltip? {
val stack = entry.value.asImmutableItemStack()
- val lore = stack.getTooltip(
- Item.TooltipContext.DEFAULT,
- null,
- TooltipType.BASIC
- )
+
+ val lore = mutableListOf(stack.displayNameAccordingToNbt)
+ lore.addAll(stack.loreAccordingToNbt)
+
+ // TODO: tags aren't sent as early now so some tooltip components that use tags will crash the game
+// stack.getTooltip(
+// Item.TooltipContext.create(
+// tooltipContext.vanillaContext().registryLookup
+// ?: MC.defaultRegistries
+// ),
+// MC.player,
+// TooltipType.BASIC
+// )
return Tooltip.create(lore)
}