import cpw.mods.fml.client.FMLClientHandler;
public class RenderAphorismTile extends TileEntitySpecialRenderer{
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f){
TileEntityAphorismTile tile = (TileEntityAphorismTile)tileentity;
GL11.glPushMatrix(); // start
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
PneumaticCraftUtils.rotateMatrixByMetadata(tile.getBlockMetadata());
GL11.glTranslatef(0, 1, 0.5F - BBConstants.APHORISM_TILE_THICKNESS - 0.01F);
List<String> textLines = tile.getTextLines();
int lineWidth = getMaxLineWidth(textLines);
int lineHeight = 10 * textLines.size();
float textScale = Math.min(14 / 16F / lineWidth, 14 / 16F / lineHeight);
GL11.glScalef(textScale, textScale, textScale);
GL11.glRotatef(tile.textRotation * 90, 0, 0, 1);