public boolean updatingLighting() {
        if (this.lightingUpdatesCounter >= 50) {
            return false;
        } else {
            ++this.lightingUpdatesCounter;

            try {
                int var1 = 500;

                boolean var2;
                while (this.lightingToUpdate.size() > 0) {
                    --var1;
                    if (var1 <= 0) {
                        var2 = true;
                        return var2;
                    }

                    ((MetadataChunkBlock) this.lightingToUpdate.remove(this.lightingToUpdate.size() - 1)).updateChunkLighting(this);
                }

                var2 = false;
                return var2;
            } finally {
                --this.lightingUpdatesCounter;
            }
        }
    }