Fix server startup query info not including new text

This commit is contained in:
tterrag 2020-05-23 16:22:29 -04:00
parent eb9c966095
commit 6829324f5a

View file

@ -316,14 +316,29 @@ public class StartupQuery {
DedicatedServer server = serverSupplier.get(); DedicatedServer server = serverSupplier.get();
if (query.getResult() == null) if (query.getResult() == null)
{ {
LOGGER.warn(SQ, query.getText()); if (!query.getHeader().isEmpty())
{
LOGGER.warn(SQ, "\n" + query.getHeader() + "\n");
}
LOGGER.warn(SQ, "\n" + query.getText());
if (!query.getAction().isEmpty())
{
LOGGER.warn(SQ, "\n\n" + query.getAction());
}
query.finish(); query.finish();
} }
else else
{ {
String text = query.getText() + StringBuilder text = new StringBuilder("\n");
"\n\nRun the command /fml confirm or or /fml cancel to proceed." + if (!query.getHeader().isEmpty()) {
"\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer."; text.append(query.getHeader()).append("\n\n");
}
text.append(query.getText()).append("\n");
if (!query.getAction().isEmpty()) {
text.append("\n").append(query.getAction());
}
text.append("\nConfirm with '/fml confirm' or cancel with '/fml cancel'.")
.append("\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer.");
LOGGER.warn(SQ, text); LOGGER.warn(SQ, text);
if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever) if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever)