if (!((ZBufferState)Spatial.getCurrentState(RenderState.RS_ZBUFFER)).isWritable()) { Spatial.defaultStateList[RenderState.RS_ZBUFFER].apply();
if (Spatial.getCurrentState(RenderState.RS_ZBUFFER) != null && !((ZBufferState)Spatial.getCurrentState(RenderState.RS_ZBUFFER)).isWritable()) { if (Spatial.defaultStateList[RenderState.RS_ZBUFFER] != null) Spatial.defaultStateList[RenderState.RS_ZBUFFER].apply();
    public void displayBackBuffer() {        // render queue if needed        processingQueue = true;        queue.renderBuckets();        if (!((ZBufferState)Spatial.getCurrentState(RenderState.RS_ZBUFFER)).isWritable()) {          Spatial.defaultStateList[RenderState.RS_ZBUFFER].apply();          Spatial.clearCurrentState(RenderState.RS_ZBUFFER);        }        processingQueue = false;        GL11.glFlush();        Display.update();    }