private static final ModelSpreader model = new ModelSpreader();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileSpreader spreader = (TileSpreader) tileentity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
GL11.glRotatef(spreader.rotationX + 90F, 0F, 1F, 0F);
GL11.glTranslatef(0F, -1F, 0F);
GL11.glRotatef(spreader.rotationY, 1F, 0F, 0F);
GL11.glTranslatef(0F, 1F, 0F);
Minecraft.getMinecraft().renderEngine.bindTexture(spreader.isRedstone() ? textureRs : spreader.isDreamwood() ? textureDw : texture);
GL11.glScalef(1F, -1F, -1F);
double time = ClientTickHandler.ticksInGame + f;
if(spreader.isULTRA_SPREADER()) {
Color color = Color.getHSBColor((float) ((time * 5 + new Random(spreader.xCoord ^ spreader.yCoord ^ spreader.zCoord).nextInt(10000)) % 360) / 360F, 0.4F, 0.9F);
GL11.glColor3f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
}
model.render();
GL11.glColor3f(1F, 1F, 1F);
GL11.glPushMatrix();
double worldTicks = tileentity.getWorldObj() == null ? 0 : time;
GL11.glRotatef((float) worldTicks % 360, 0F, 1F, 0F);
GL11.glTranslatef(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F);
model.renderCube();
GL11.glPopMatrix();
GL11.glScalef(1F, -1F, -1F);
ItemStack stack = spreader.getStackInSlot(0);
if(stack != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
ILens lens = (ILens) stack.getItem();
GL11.glPushMatrix();