Skip to content

Commit

Permalink
Update ConsoleCommandCompleter.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Mar 22, 2024
1 parent 59fac5d commit bfa27e4
Showing 1 changed file with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.jline.reader.ParsedLine;
// Paper end


public class ConsoleCommandCompleter implements Completer {
private final DedicatedServer server; // Paper - CraftServer -> DedicatedServer

Expand Down Expand Up @@ -72,36 +71,5 @@ protected List<String> evaluate() {
}
};
server.getServer().processQueue.add(waitable); // Paper - Remove "this."
try {
List<String> offers = waitable.get();
if (offers == null) {
return; // Paper - Method returns void
}

// Paper start - JLine update
for (String completion : offers) {
if (completion.isEmpty()) {
continue;
}

candidates.add(new Candidate(completion));
}
// Paper end

// Paper start - JLine handles cursor now
/*
final int lastSpace = buffer.lastIndexOf(' ');
if (lastSpace == -1) {
return cursor - buffer.length();
} else {
return cursor - (buffer.length() - lastSpace - 1);
}
*/
// Paper end
} catch (ExecutionException e) {
server.getLogger().log(Level.WARNING, "Unhandled exception when tab completing", e); // Paper - Remove "this."
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}

0 comments on commit bfa27e4

Please sign in to comment.