Made the slash optional in fml confirm/cancel. (#6282)

This commit is contained in:
DaemonUmbra 2019-11-05 14:10:19 -05:00 committed by LexManos
parent b8ea220925
commit 7f8b30aed3
1 changed files with 4 additions and 3 deletions

View File

@ -280,22 +280,23 @@ public class StartupQuery {
for (Iterator<PendingCommand> it = dedServer.pendingCommandList.iterator(); it.hasNext(); ) for (Iterator<PendingCommand> it = dedServer.pendingCommandList.iterator(); it.hasNext(); )
{ {
String cmd = it.next().command.trim().toLowerCase(); String cmd = it.next().command.trim().toLowerCase();
cmd = cmd.charAt(0) == '/' ? cmd.substring(1) : cmd; // strip the forward slash to make it optional
if (cmd.equals("/fml confirm")) if (cmd.equals("fml confirm"))
{ {
LOGGER.info(SQ, "confirmed"); LOGGER.info(SQ, "confirmed");
query.setResult(true); query.setResult(true);
done = true; done = true;
it.remove(); it.remove();
} }
else if (cmd.equals("/fml cancel")) else if (cmd.equals("fml cancel"))
{ {
LOGGER.info(SQ, "cancelled"); LOGGER.info(SQ, "cancelled");
query.setResult(false); query.setResult(false);
done = true; done = true;
it.remove(); it.remove();
} }
else if (cmd.equals("/stop")) else if (cmd.equals("stop"))
{ {
StartupQuery.abort(); StartupQuery.abort();
} }