/**
 * Aeronica's mxTune MOD
 * Copyright {2016} Paul Boese a.k.a. Aeronica
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.aeronica.mods.mxtune.handler;

import net.aeronica.mods.mxtune.groups.GROUPS;
import net.aeronica.mods.mxtune.init.IReBakeModel;
import net.aeronica.mods.mxtune.init.ModModelManager;
import net.aeronica.mods.mxtune.render.PlacardRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;

@Mod.EventBusSubscriber(Side.CLIENT)
public class ClientEventHandler
{
    
    static Minecraft mc = Minecraft.getMinecraft();
    static PlacardRenderer placardRenderer = PlacardRenderer.getInstance();

    private ClientEventHandler() {}

    /** Render Placards */
    @SubscribeEvent
    public static void onRenderPlayerEvent(RenderLivingEvent.Specials.Post<EntityLivingBase> event)
    {
        if (event.getEntity() instanceof EntityPlayer && !event.getEntity().isInvisible() && !mc.gameSettings.showDebugInfo && !mc.gameSettings.hideGUI)
        {
            if (
                    GROUPS.getClientMembers() != null /* (mc.thePlayer.equals(player)) */
                    && GROUPS.getClientMembers().containsKey(event.getEntity().getEntityId()) &&
                    !(mc.gameSettings.thirdPersonView == 0 && mc.player.equals(event.getEntity())))
            {
                placardRenderer.setPlacard(GROUPS.getIndex(event.getEntity().getEntityId()));
                placardRenderer.doRender(event);
            }
        }
    } 
    
    @SubscribeEvent
    public static void textureRestitchEvent(TextureStitchEvent.Post e)
    {
        ModModelManager.getTESRRenderers().stream().filter(p -> p instanceof IReBakeModel).forEach(p -> ((IReBakeModel)p).reBakeModel());
    }

}

@@ -772,16 +772,63 @@
 eModel;%0A
+import net.aeronica.mods.mxtune.init.ModItems;%0A
 import n
@@ -869,24 +869,24 @@
 delManager;%0A
-
 import net.a
@@ -968,16 +968,60 @@
 ecraft;%0A
+import net.minecraft.client.resources.I18n;%0A
 import n
@@ -1103,24 +1103,71 @@
 tityPlayer;%0A
+import net.minecraft.util.text.TextFormatting;%0A
 import net.m
@@ -1208,24 +1208,24 @@
 ivingEvent;%0A
-
 import net.m
@@ -1267,24 +1267,88 @@
 titchEvent;%0A
+import net.minecraftforge.event.entity.player.ItemTooltipEvent;%0A
 import net.m
@@ -2788,10 +2788,293 @@
 %0A    %7D%0A%0A
+    @SubscribeEvent%0A    public static void onEvent(ItemTooltipEvent event)%0A    %7B%0A        if (event.getItemStack().getItem().equals(ModItems.ITEM_BAND_AMP))%0A        %7B%0A            event.getToolTip().add(TextFormatting.GREEN + I18n.format(%22tile.mxtune:band_amp.help%22));%0A        %7D%0A    %7D%0A
 %7D%0A

Add tooltip to the band_amp itemblock via the item tooltip event.