Fix /tp <target> acting like /tphere

This commit is contained in:
William committed 2022-02-21 22:25:55 +00:00
1 parent 9d004cf38c
commit a0ce0dc52a
1 file changed
+6 -4
@@ -339,10 +339,12 @@ public class TpCommand extends CommandBase {
}
case "<target>" -> {
target = inputArgument;
if (inputExecutor instanceof Player playerExecutor) {
if (NameAutoCompleter.getAutoCompletedName(target).equalsIgnoreCase(playerExecutor.getName()) && tpHereTarget != null) {
TpHereCommand.executeTpHere(playerExecutor, tpHereTarget);
return HandlerResponse.CANNOT_HANDLE_HANDLED_BY_TP_HERE;
if (arguments.length == 2) {
if (inputExecutor instanceof Player playerExecutor) {
if (NameAutoCompleter.getAutoCompletedName(target).equalsIgnoreCase(playerExecutor.getName()) && tpHereTarget != null) {
TpHereCommand.executeTpHere(playerExecutor, tpHereTarget);
return HandlerResponse.CANNOT_HANDLE_HANDLED_BY_TP_HERE;
}
}
}
return HandlerResponse.CAN_HANDLE;