/** Sets the serverRunning variable to false, in order to get the server to shut down. */ public void initiateShutdown() { super.initiateShutdown(); if (this.lanServerPing != null) { this.lanServerPing.interrupt(); this.lanServerPing = null; } }
public void windowClosing(WindowEvent par1WindowEvent) { mcServer.initiateShutdown(); while (!mcServer.serverStopped) { try { Thread.sleep(100L); } catch (InterruptedException interruptedexception) { interruptedexception.printStackTrace(); } } System.exit(0); }