All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.craftbukkit.util.ServerShutdownThread Maven / Gradle / Ivy

package org.bukkit.craftbukkit.util;

import net.minecraft.server.ExceptionWorldConflict;
import net.minecraft.server.MinecraftServer;

public class ServerShutdownThread extends Thread {
  private final MinecraftServer server;

  public ServerShutdownThread(MinecraftServer server) {
    this.server = server;
  }

  @Override
  public void run() {
    try {
      server.stop();
    } catch (ExceptionWorldConflict ex) {
      ex.printStackTrace();
    } finally {
      try {
        server.reader.getTerminal().restore();
      } catch (Exception e) {
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy