fix,refactor: fix findalts and use thenApplyAsync instead of thenApply for non-blocking

This commit is contained in:
ChomeNS
2024-11-16 18:41:34 +07:00
parent 9b824e195a
commit 65aa230260
10 changed files with 21 additions and 23 deletions

View File

@@ -68,10 +68,10 @@ public class PlayersPlugin extends Bot.Listener {
if (trackedCoreFuture == null) return null;
trackedCoreFuture.thenApply(output -> {
trackedCoreFuture.thenApplyAsync(output -> {
final List<Component> children = output.children();
String stringified = ComponentUtilities.stringify(Component.join(JoinConfiguration.separator(Component.space()), children));
String stringified = ComponentUtilities.stringify(Component.join(JoinConfiguration.separator(Component.empty()), children));
if (!stringified.startsWith(" - IP Address: ")) return output;
@@ -192,7 +192,7 @@ public class PlayersPlugin extends Bot.Listener {
final PlayerEntry target = getEntry(uuid);
if (target == null) return;
bot.tabComplete.tabComplete("/minecraft:scoreboard players add ").thenApply(packet -> {
bot.tabComplete.tabComplete("/minecraft:scoreboard players add ").thenApplyAsync(packet -> {
final String[] matches = packet.getMatches();
final Component[] tooltips = packet.getTooltips();
final String username = target.profile.getName();