blob: e7f29d68555b147a938783a9c84227f38b0e9e73 [file] [log] [blame] [raw]
package com.legacy.aether.compatibility.client;
import com.legacy.aether.client.renders.AetherItemRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import mods.battlegear2.api.RenderPlayerEventChild.PlayerElementType;
import mods.battlegear2.api.RenderPlayerEventChild.PostRenderPlayerElement;
public class BattlegearClientEventHandler
{
@SubscribeEvent
public void renderOffhandGloveEvent(PostRenderPlayerElement event)
{
EntityRenderer renderer = Minecraft.getMinecraft().entityRenderer;
if (event.type == PlayerElementType.Offhand && event.isFirstPerson && renderer != null && renderer.itemRenderer instanceof AetherItemRenderer)
{
((AetherItemRenderer)renderer.itemRenderer).renderFirstPersonArm((RenderPlayer) RenderManager.instance.getEntityRenderObject(Minecraft.getMinecraft().thePlayer), Minecraft.getMinecraft().thePlayer);
}
}
}