Merge pull request #294 from BurgerbudeORG/fix/command-pattern-syntax

Fix a tab completion bug/crash
This commit is contained in:
TheMode 2021-05-17 20:43:15 +02:00 committed by GitHub
commit d5521ac5ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import net.minestom.server.network.packet.server.play.TabCompletePacket;
import net.minestom.server.utils.StringUtils;
import java.util.Arrays;
import java.util.regex.Pattern;
public class TabCompleteListener {
@ -23,8 +24,7 @@ public class TabCompleteListener {
String commandString = packet.text.replaceFirst(CommandManager.COMMAND_PREFIX, "");
String[] split = commandString.split(StringUtils.SPACE);
String commandName = split[0];
String args = commandString.replaceFirst(commandName, "");
String args = commandString.replaceFirst(Pattern.quote(commandName), "");
final CommandQueryResult commandQueryResult = CommandParser.findCommand(commandString);
if (commandQueryResult == null) {