    001package net.minecraft.client.renderer.tileentity;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.client.renderer.entity.RenderManager;
    006import net.minecraft.entity.Entity;
    007import net.minecraft.tileentity.MobSpawnerBaseLogic;
    008import net.minecraft.tileentity.TileEntity;
    009import net.minecraft.tileentity.TileEntityMobSpawner;
    010import org.lwjgl.opengl.GL11;
    011
    012@SideOnly(Side.CLIENT)
    013public class TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer
    014{
    015    public void renderTileEntityMobSpawner(TileEntityMobSpawner par1TileEntityMobSpawner, double par2, double par4, double par6, float par8)
    016    {
    017        GL11.glPushMatrix();
    018        GL11.glTranslatef((float)par2 + 0.5F, (float)par4, (float)par6 + 0.5F);
    019        func_98144_a(par1TileEntityMobSpawner.func_98049_a(), par2, par4, par6, par8);
    020        GL11.glPopMatrix();
    021    }
    022
    023    public static void func_98144_a(MobSpawnerBaseLogic par0MobSpawnerBaseLogic, double par1, double par3, double par5, float par7)
    024    {
    025        Entity entity = par0MobSpawnerBaseLogic.func_98281_h();
    026
    027        if (entity != null)
    028        {
    029            entity.setWorld(par0MobSpawnerBaseLogic.func_98271_a());
    030            float f1 = 0.4375F;
    031            GL11.glTranslatef(0.0F, 0.4F, 0.0F);
    032            GL11.glRotatef((float)(par0MobSpawnerBaseLogic.field_98284_d + (par0MobSpawnerBaseLogic.field_98287_c - par0MobSpawnerBaseLogic.field_98284_d) * (double)par7) * 10.0F, 0.0F, 1.0F, 0.0F);
    033            GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
    034            GL11.glTranslatef(0.0F, -0.4F, 0.0F);
    035            GL11.glScalef(f1, f1, f1);
    036            entity.setLocationAndAngles(par1, par3, par5, 0.0F, 0.0F);
    037            RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, par7);
    038        }
    039    }
    040
    041    public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
    042    {
    043        this.renderTileEntityMobSpawner((TileEntityMobSpawner)par1TileEntity, par2, par4, par6, par8);
    044    }
    045}