Use default shutdown reason if the disconnect message is blank.

This commit is contained in:
Andrew Steinborn
2020-07-30 06:01:38 -04:00
parent 4c5636e6f7
commit 306221a92f

View File

@@ -15,8 +15,12 @@ public class ShutdownCommand implements RawCommand {
@Override
public void execute(final Invocation invocation) {
String reason = invocation.arguments();
if (reason.isEmpty() || reason.trim().isEmpty()) {
server.shutdown(true);
} else {
server.shutdown(true, LegacyComponentSerializer.legacy('&').deserialize(reason));
}
}
@Override
public boolean hasPermission(final Invocation invocation) {