@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)
{
if (tileEntity instanceof TileEntityGlassBell)
{
TileEntityGlassBell tileEntityGlassBell = (TileEntityGlassBell) tileEntity;
GL11.glDisable(GL11.GL_CULL_FACE);
/**
* Render the Glass Bell
*/
GL11.glPushMatrix();
// Scale, Translate, Rotate
renderGlassBellByOrientation(x, y, z, tileEntityGlassBell.getOrientation());
// Bind texture
this.bindTexture(Textures.Model.GLASS_BELL);
modelGlassBell.render();
GL11.glPopMatrix();
/**
* Render the ghost item inside of the Glass Bell, slowly spinning
*/
GL11.glPushMatrix();
if (tileEntityGlassBell.outputItemStack != null)
{
// TODO Stop the ghost item rendering in the event that the client's game is paused
float scaleFactor = getGhostItemScaleFactor(tileEntityGlassBell.outputItemStack);
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
EntityItem ghostEntityItem = new EntityItem(tileEntityGlassBell.getWorldObj());
ghostEntityItem.hoverStart = 0.0F;
ghostEntityItem.setEntityItemStack(tileEntityGlassBell.outputItemStack);
translateGhostItemByOrientation(ghostEntityItem.getEntityItem(), x, y, z, tileEntityGlassBell.getOrientation());
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
GL11.glRotatef(rotationAngle, 0.0F, 1.0F, 0.0F);
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
}