fix: Re-add extra item tooltips to the item list
This commit is contained in:
@@ -27,7 +27,9 @@ import net.minecraft.client.render.VertexConsumerProvider
|
|||||||
import net.minecraft.client.render.model.BakedModel
|
import net.minecraft.client.render.model.BakedModel
|
||||||
import net.minecraft.client.texture.SpriteAtlasTexture
|
import net.minecraft.client.texture.SpriteAtlasTexture
|
||||||
import net.minecraft.item.ModelTransformationMode
|
import net.minecraft.item.ModelTransformationMode
|
||||||
|
import net.minecraft.item.tooltip.TooltipType
|
||||||
import moe.nea.firmament.compat.rei.FirmamentReiPlugin.Companion.asItemEntry
|
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.repo.SBItemStack
|
||||||
import moe.nea.firmament.util.MC
|
import moe.nea.firmament.util.MC
|
||||||
import moe.nea.firmament.util.mc.displayNameAccordingToNbt
|
import moe.nea.firmament.util.mc.displayNameAccordingToNbt
|
||||||
@@ -52,7 +54,12 @@ object NEUItemEntryRenderer : EntryRenderer<SBItemStack>, BatchedEntryRenderer<S
|
|||||||
|
|
||||||
val lore = mutableListOf(stack.displayNameAccordingToNbt)
|
val lore = mutableListOf(stack.displayNameAccordingToNbt)
|
||||||
lore.addAll(stack.loreAccordingToNbt)
|
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
|
// TODO: tags aren't sent as early now so some tooltip components that use tags will crash the game
|
||||||
// stack.getTooltip(
|
// stack.getTooltip(
|
||||||
// Item.TooltipContext.create(
|
// Item.TooltipContext.create(
|
||||||
|
|||||||
@@ -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>()
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user