shutodwn hook
This commit is contained in:
@@ -33,6 +33,7 @@ public class Main {
|
||||
gameLoop.start();
|
||||
|
||||
Server server = appContext.getBean("server", Server.class);
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(server::stop));
|
||||
try {
|
||||
server.start();
|
||||
} catch (StartServerException e) {
|
||||
|
||||
@@ -6,4 +6,5 @@ package mc.core.network;
|
||||
|
||||
public interface Server {
|
||||
void start() throws StartServerException;
|
||||
void stop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user