~williewillus/botania

3a217acde99f5a17640c0bf2f2c51d2ebce05954 — Artemis System 29 days ago 2b2b45e
Fix akashic tome compat in the lexica render
1 files changed, 4 insertions(+), 1 deletions(-)

M Xplat/src/main/java/vazkii/botania/common/item/LexicaBotaniaItem.java
M Xplat/src/main/java/vazkii/botania/common/item/LexicaBotaniaItem.java => Xplat/src/main/java/vazkii/botania/common/item/LexicaBotaniaItem.java +4 -1
@@ 10,6 10,7 @@ package vazkii.botania.common.item;

import net.minecraft.ChatFormatting;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.tags.TagKey;


@@ 84,9 85,11 @@ public class LexicaBotaniaItem extends Item implements ItemWithBannerPattern, Cu
	public static Component getTitle(ItemStack stack) {
		Component title = stack.getHoverName();

		// Akashic tome tag contains a `text` field, which is a stringified text component
		String akashicTomeNBT = "akashictome:displayName";
		if (stack.hasTag() && stack.getTag().contains(akashicTomeNBT)) {
			title = Component.Serializer.fromJson(stack.getTag().getString(akashicTomeNBT));
			CompoundTag nameTextComponent = stack.getTag().getCompound(akashicTomeNBT);
			title = Component.Serializer.fromJson(nameTextComponent.getString("text"));
		}

		return title;