fix: core tracked query issue

This commit is contained in:
Chayapak 2025-03-19 15:14:24 +07:00
parent 5fdb86c81c
commit 079c579b0e
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA
12 changed files with 14 additions and 14 deletions

View file

@ -1 +1 @@
1977
1988

View file

@ -107,7 +107,7 @@ public class CommandBlockCommand extends Command {
if (future == null) return;
future.thenApplyAsync(output -> {
future.thenApply(output -> {
if (player == null) context.sendOutput(output);
else {
final Component component = Component

View file

@ -38,7 +38,7 @@ public class EvalCommand extends Command {
final CompletableFuture<EvalOutput> future = bot.eval.run(command);
future.thenApplyAsync(output -> {
future.thenApply(output -> {
if (output.isError()) context.sendOutput(Component.text(output.output()).color(NamedTextColor.RED));
else context.sendOutput(Component.text(output.output()));

View file

@ -54,7 +54,7 @@ public class FindAltsCommand extends Command {
final String tempFinalPlayer = player;
future.thenApplyAsync(targetIP -> {
future.thenApply(targetIP -> {
context.sendOutput(handle(bot, targetIP, false, tempFinalPlayer, allServer));
return targetIP;

View file

@ -74,7 +74,7 @@ public class MailCommand extends Command {
"SelectedItem.components.minecraft:custom_data.message"
);
future.thenApplyAsync(output -> {
future.thenApply(output -> {
try {
if (output == null) {
throw new CommandException(Component.text("Player has no `message` NBT tag in their selected item's minecraft:custom_data"));

View file

@ -187,7 +187,7 @@ public class MusicCommand extends Command {
"SelectedItem.components.minecraft:custom_data.SongItemData.SongData"
);
future.thenApplyAsync(output -> {
future.thenApply(output -> {
if (output == null) {
context.sendOutput(Component.text("Player has no `SongItemData.SongData` NBT tag in their selected item's minecraft:custom_data").color(NamedTextColor.RED));
return null;

View file

@ -32,7 +32,7 @@ public class AuthPlugin extends PlayersPlugin.Listener {
future.completeOnTimeout("", 10, TimeUnit.SECONDS);
future.thenApplyAsync(ip -> {
future.thenApply(ip -> {
bot.logger.log(
LogType.AUTH,
Component.translatable(

View file

@ -220,7 +220,7 @@ public class CorePlugin extends PositionPlugin.Listener {
return null;
}
final Vector3i coreBlock = block;
final Vector3i coreBlock = block.clone();
run(command);
@ -228,7 +228,7 @@ public class CorePlugin extends PositionPlugin.Listener {
final CompletableFuture<String> future = bot.query.block(coreBlock, "LastOutput");
future.thenApplyAsync(output -> {
future.thenApply(output -> {
if (output == null) return null;
trackedFuture.complete(

View file

@ -71,7 +71,7 @@ public class IPFilterPlugin extends PlayersPlugin.Listener {
if (future == null) return;
future.thenApplyAsync(output -> {
future.thenApply(output -> {
handleFilterManager(output, target);
return output;

View file

@ -156,7 +156,7 @@ public class PlayersDatabasePlugin extends PlayersPlugin.Listener {
if (future == null) return;
future.thenApplyAsync(output -> {
future.thenApply(output -> {
if (output == null) return null;
try {

View file

@ -90,7 +90,7 @@ public class PlayersPlugin extends Bot.Listener {
trackedCoreFuture.completeOnTimeout(null, 5, TimeUnit.SECONDS);
trackedCoreFuture.thenApplyAsync(output -> {
trackedCoreFuture.thenApply(output -> {
final List<Component> children = output.children();
String stringified = ComponentUtilities.stringify(Component.join(JoinConfiguration.separator(Component.empty()), children));
@ -236,7 +236,7 @@ public class PlayersPlugin extends Bot.Listener {
private void check (PlayerEntry target) {
final CompletableFuture<String> future = getLastKnownName(target.profile.getIdAsString());
future.thenApplyAsync(lastKnownName -> {
future.thenApply(lastKnownName -> {
if (lastKnownName == null) {
list.remove(target);

View file

@ -28,7 +28,7 @@ public class ServerPluginsManagerPlugin extends Bot.Listener {
public void connected (ConnectedEvent event) {
final CompletableFuture<ClientboundCommandSuggestionsPacket> future = bot.tabComplete.tabComplete("ver ");
future.thenApplyAsync((packet) -> {
future.thenApply((packet) -> {
final String[] matches = packet.getMatches();
// should i just use the plugins as the String array instead of a list?