public void renderTile(AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float partialTick, RenderBlocks renderer)
{
if ( !(tile instanceof TileSkyCompass) )
return;
TileSkyCompass skyCompass = (TileSkyCompass) tile;
if ( !skyCompass.hasWorldObj() )
return;
GL11.glEnable( 32826 /* GL_RESCALE_NORMAL_EXT */);
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
ResourceLocation loc = new ResourceLocation( "appliedenergistics2", "textures/models/compass.png" );
Minecraft.getMinecraft().getTextureManager().bindTexture( loc );
this.applyTESRRotation( x, y, z, skyCompass.getUp(), skyCompass.getForward() );
GL11.glScalef( 1.0F, -1F, -1F );
GL11.glTranslatef( 0.5F, -1.5F, -0.5F );
long now = System.currentTimeMillis();
CompassResult cr = null;
if ( skyCompass.getForward() == ForgeDirection.UP || skyCompass.getForward() == ForgeDirection.DOWN )
cr = CompassManager.instance.getCompassDirection( 0, tile.xCoord, tile.yCoord, tile.zCoord );
else
cr = new CompassResult( false, true, 0 );
if ( cr.hasResult )
{
if ( cr.spin )
{
now = now % 100000;
model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
}
else
model.renderAll( (float) (skyCompass.getForward() == ForgeDirection.DOWN ? flipidiy( cr.rad ) : cr.rad) );
}
else
{
now = now % 1000000;