diff --git a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java index 14a86c7..f137c83 100644 --- a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java +++ b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToe.java @@ -267,7 +267,7 @@ protected static int[] extractIntegerArgs(String args[]) { return integerArguments; } - private static ArrayList removeEmptyElementsExceptForLast(String[] list) { + static ArrayList removeEmptyElementsExceptForLast(String[] list) { ArrayList newList = new ArrayList(); int i = 0; for(String element: list) { diff --git a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToeAccept.java b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToeAccept.java index 4258ac1..ad60f90 100644 --- a/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToeAccept.java +++ b/mavenmcserver/src/main/java/mavenmcserver/command/CommandTicTacToeAccept.java @@ -75,7 +75,7 @@ public List onTabComplete(CommandSender sender, Command command, String if(!(sender instanceof Player)) return new ArrayList(); - ArrayList argList = CommandTicTacToeAccept.removeMeaninglessElements(args); + ArrayList argList = CommandTicTacToe.removeEmptyElementsExceptForLast(args); if(argList.size() > CommandTicTacToeAccept.ARG_COUNT) return new ArrayList(); @@ -91,21 +91,6 @@ public List onTabComplete(CommandSender sender, Command command, String return filteredCompletions; } - public static ArrayList removeMeaninglessElements(String[] list) { - ArrayList newList = new ArrayList(); - - int i = 0; - for(String element: list) { - if(!element.isEmpty() || (i == list.length - 1)) { - newList.add(element); - } - - i++; - } - - return newList; - } - public static boolean listContainsNonEmptyString(List list) { for(String string: list) { if(!string.isEmpty()) return true;