package ru.stalmine.GLLoader.render;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import ru.stalmine.blocks.modelsblocks.EntityBlockMi24Dead;
import ru.stalmine.until.GLModel;
public class BlockMi24Dead_r extends TileEntitySpecialRenderer
{
private static GLModel ModelHeliCrash;
public BlockMi24Dead_r()
{
ModelHeliCrash = new GLModel("/assets/stalmine/obj/mi24dead.obj");
}
public void renderTileEntityAt(TileEntity tileEntity, double d1, double d2, double d3, float f)
{
this.renderTileEntity((EntityBlockMi24Dead)tileEntity, d1, d2, d3, f);
}
public void renderTileEntity(EntityBlockMi24Dead tileEntity, double d1, double d2, double d3, float f)
{
short rotation = 180;
if (tileEntity != null && tileEntity.worldObj != null)
{
int md = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
if (md == 0)
{
rotation = 90;
}
if (md == 1)
{
rotation = 0;
}
if (md == 2)
{
rotation = 270;
}
}
GL11.glPushMatrix();
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glTranslatef((float)d1 + 0.5F, (float)d2 + 1.5F, (float)d3 + 0.5F);
GL11.glTranslatef(0.0F, -1.5F, 0.0F);
GL11.glRotatef((float)(rotation + 180), 0.0F, 1.0F, 0.0F);
GL11.glScalef(0.9F, 1.0F, 0.9F);
ModelHeliCrash.render();
GL11.glPopMatrix();
}
}