protected void y() throws ExceptionWorldConflict { // CraftBukkit - added throws
    SpigotTimings.serverTickTimer.startTiming(); // Spigot
    long i = System.nanoTime();

    ++this.ticks;
    if (this.T) {
      this.T = false;
      this.methodProfiler.a = true;
      this.methodProfiler.a();
    }

    this.methodProfiler.a("root");
    this.z();
    if (i - this.X >= 5000000000L) {
      this.X = i;
      this.r.setPlayerSample(new ServerPingPlayerSample(this.H(), this.G()));
      GameProfile[] agameprofile = new GameProfile[Math.min(this.G(), 12)];
      int j = MathHelper.nextInt(this.s, 0, this.G() - agameprofile.length);

      for (int k = 0; k < agameprofile.length; ++k) {
        agameprofile[k] = ((EntityPlayer) this.v.players.get(j + k)).getProfile();
      }

      Collections.shuffle(Arrays.asList(agameprofile));
      this.r.b().a(agameprofile);
    }

    if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
      SpigotTimings.worldSaveTimer.startTiming(); // Spigot
      this.methodProfiler.a("save");
      this.v.savePlayers();
      // Spigot Start
      // We replace this with saving each individual world as this.saveChunks(...) is broken,
      // and causes the main thread to sleep for random amounts of time depending on chunk activity
      // Also pass flag to only save modified chunks
      server.playerCommandState = true;
      for (World world : worlds) {
        world.getWorld().save(false);
      }
      server.playerCommandState = false;
      // this.saveChunks(true);
      // Spigot End
      this.methodProfiler.b();
      SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
    }

    this.methodProfiler.a("tallying");
    this.g[this.ticks % 100] = System.nanoTime() - i;
    this.methodProfiler.b();
    this.methodProfiler.a("snooper");
    if (getSnooperEnabled() && !this.m.d() && this.ticks > 100) { // Spigot
      this.m.a();
    }

    if (getSnooperEnabled() && this.ticks % 6000 == 0) { // Spigot
      this.m.b();
    }

    this.methodProfiler.b();
    this.methodProfiler.b();
    org.spigotmc.WatchdogThread.tick(); // Spigot
    SpigotTimings.serverTickTimer.stopTiming(); // Spigot
    org.spigotmc.CustomTimingsHandler.tick(); // Spigot
  }