private void updateWaterOpacity() {
        byte opacity = 3;

        if (this.ofClearWater) {
            opacity = 1;
        }

        Block.waterStill.setLightOpacity(opacity);
        Block.waterMoving.setLightOpacity(opacity);
        if (this.mc.theWorld != null) {
            IChunkProvider cp = this.mc.theWorld.chunkProvider;

            if (cp != null) {
                for (int x = -512; x < 512; ++x) {
                    for (int z = -512; z < 512; ++z) {
                        if (cp.chunkExists(x, z)) {
                            Chunk c = cp.provideChunk(x, z);

                            if (c != null) {
                                byte[] data = c.skylightMap.data;

                                for (int i = 0; i < data.length; ++i) {
                                    data[i] = 0;
                                }

                                c.generateSkylightMap();
                            }
                        }
                    }
                }

                this.mc.renderGlobal.loadRenderers();
            }
        }
    }