package aeronicamc.mods.mxtune.events;

import aeronicamc.mods.mxtune.Reference;
import aeronicamc.mods.mxtune.init.ModBlocks;
import aeronicamc.mods.mxtune.init.ModItems;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = Reference.MOD_ID, value = Dist.CLIENT)
public class RenderEvents
{
    @SubscribeEvent
    public static void event(ItemTooltipEvent event)
    {
        if (event.getItemStack().getItem().equals(ModBlocks.MUSIC_BLOCK.get().asItem()))
            event.getToolTip().add(new TranslationTextComponent("tooltip.mxtune.block_music.help").withStyle(TextFormatting.YELLOW));
        else if (event.getItemStack().getItem().equals(ModItems.MUSIC_PAPER.get()))
            event.getToolTip().add(new TranslationTextComponent("tooltip.mxtune.music_paper.help").withStyle(TextFormatting.YELLOW));
    }
}

@@ -165,16 +165,288 @@
 dItems;%0A
+import aeronicamc.mods.mxtune.util.IInstrument;%0Aimport aeronicamc.mods.mxtune.util.SheetMusicHelper;%0Aimport net.minecraft.client.Minecraft;%0Aimport net.minecraft.client.gui.FontRenderer;%0Aimport net.minecraft.entity.player.PlayerEntity;%0Aimport net.minecraft.item.ItemStack;%0A
 import n
@@ -484,16 +484,16 @@
 atting;%0A
-
 import n
@@ -588,16 +588,79 @@
 r.Dist;%0A
+import net.minecraftforge.client.event.RenderGameOverlayEvent;%0A
 import n
@@ -912,16 +912,81 @@
 vents%0A%7B%0A
+    private static final Minecraft mc = Minecraft.getInstance();%0A
     @Sub
@@ -1359,24 +1359,24 @@
 PER.get()))%0A
-
             
@@ -1502,11 +1502,657 @@
 );%0A    %7D
+%0A%0A    @SubscribeEvent%0A    public static void event(RenderGameOverlayEvent.Post event)%0A    %7B%0A        PlayerEntity player = mc.player;%0A        ItemStack itemStack = player.inventory.getSelected();%0A%0A        if (event.getType() == RenderGameOverlayEvent.ElementType.ALL && (mc.screen == null) && itemStack.getItem() instanceof IInstrument)%0A        %7B%0A            FontRenderer fontRenderer = Minecraft.getInstance().font;%0A            ItemStack sheetMusic = SheetMusicHelper.getIMusicFromIInstrument(itemStack);%0A            fontRenderer.drawShadow(event.getMatrixStack(), SheetMusicHelper.getFormattedMusicTitle(sheetMusic), 10, 10, -1);%0A        %7D%0A    %7D
 %0A%7D%0A

Test in-game gui overlay rendering.