diff --git a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java index cdc1fc7..4adea6c 100644 --- a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java +++ b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java @@ -60,14 +60,6 @@ public boolean onCommand(CommandSender sender, Command command, String label, St if(args.length < CommandTicTacToe.MIN_VALID_ARG_COUNT) { return false; } - - boolean playerIsCurrentlyInAGame = Game.runningGames.containsKey((Player)sender); - boolean playerProvidedCancelKeyword = args[CommandTicTacToe.OPPONENT_ARG_INDEX].equals(CommandTicTacToe.CANCEL_KEYWORD); - if(playerIsCurrentlyInAGame && playerProvidedCancelKeyword) { - Game gameToCancel = Game.runningGames.get((Player)sender); - gameToCancel.end(GameEndCause.CANCEL); - return true; - } if(args.length > CommandTicTacToe.MAX_VALID_ARG_COUNT) { sender.sendMessage(ChatColor.RED + "Too many arguments for command '/" + label + "'!" + ChatColor.RESET); @@ -77,6 +69,14 @@ public boolean onCommand(CommandSender sender, Command command, String label, St if(CommandTicTacToe.isNoAvailablePlayersPlaceholder(args)) { return true; } + + boolean playerIsCurrentlyInAGame = Game.runningGames.containsKey((Player)sender); + boolean playerProvidedCancelKeyword = args[CommandTicTacToe.OPPONENT_ARG_INDEX].equals(CommandTicTacToe.CANCEL_KEYWORD); + if(playerIsCurrentlyInAGame && playerProvidedCancelKeyword) { + Game gameToCancel = Game.runningGames.get((Player)sender); + gameToCancel.end(GameEndCause.CANCEL); + return true; + } if(args[CommandTicTacToe.OPPONENT_ARG_INDEX].equals(CommandTicTacToe.REQUEST_RETURN_MATCH_KEYWORD)) { @@ -130,7 +130,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St new Game(config, this.plugin, false); - return false; + return true; } private static boolean isNoAvailablePlayersPlaceholder(String[] args) {