fix: core tracked query issue
This commit is contained in:
parent
5fdb86c81c
commit
079c579b0e
12 changed files with 14 additions and 14 deletions
|
@ -1 +1 @@
|
||||||
1977
|
1988
|
|
@ -107,7 +107,7 @@ public class CommandBlockCommand extends Command {
|
||||||
|
|
||||||
if (future == null) return;
|
if (future == null) return;
|
||||||
|
|
||||||
future.thenApplyAsync(output -> {
|
future.thenApply(output -> {
|
||||||
if (player == null) context.sendOutput(output);
|
if (player == null) context.sendOutput(output);
|
||||||
else {
|
else {
|
||||||
final Component component = Component
|
final Component component = Component
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class EvalCommand extends Command {
|
||||||
|
|
||||||
final CompletableFuture<EvalOutput> future = bot.eval.run(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));
|
if (output.isError()) context.sendOutput(Component.text(output.output()).color(NamedTextColor.RED));
|
||||||
else context.sendOutput(Component.text(output.output()));
|
else context.sendOutput(Component.text(output.output()));
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class FindAltsCommand extends Command {
|
||||||
|
|
||||||
final String tempFinalPlayer = player;
|
final String tempFinalPlayer = player;
|
||||||
|
|
||||||
future.thenApplyAsync(targetIP -> {
|
future.thenApply(targetIP -> {
|
||||||
context.sendOutput(handle(bot, targetIP, false, tempFinalPlayer, allServer));
|
context.sendOutput(handle(bot, targetIP, false, tempFinalPlayer, allServer));
|
||||||
|
|
||||||
return targetIP;
|
return targetIP;
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class MailCommand extends Command {
|
||||||
"SelectedItem.components.minecraft:custom_data.message"
|
"SelectedItem.components.minecraft:custom_data.message"
|
||||||
);
|
);
|
||||||
|
|
||||||
future.thenApplyAsync(output -> {
|
future.thenApply(output -> {
|
||||||
try {
|
try {
|
||||||
if (output == null) {
|
if (output == null) {
|
||||||
throw new CommandException(Component.text("Player has no `message` NBT tag in their selected item's minecraft:custom_data"));
|
throw new CommandException(Component.text("Player has no `message` NBT tag in their selected item's minecraft:custom_data"));
|
||||||
|
|
|
@ -187,7 +187,7 @@ public class MusicCommand extends Command {
|
||||||
"SelectedItem.components.minecraft:custom_data.SongItemData.SongData"
|
"SelectedItem.components.minecraft:custom_data.SongItemData.SongData"
|
||||||
);
|
);
|
||||||
|
|
||||||
future.thenApplyAsync(output -> {
|
future.thenApply(output -> {
|
||||||
if (output == null) {
|
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));
|
context.sendOutput(Component.text("Player has no `SongItemData.SongData` NBT tag in their selected item's minecraft:custom_data").color(NamedTextColor.RED));
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class AuthPlugin extends PlayersPlugin.Listener {
|
||||||
|
|
||||||
future.completeOnTimeout("", 10, TimeUnit.SECONDS);
|
future.completeOnTimeout("", 10, TimeUnit.SECONDS);
|
||||||
|
|
||||||
future.thenApplyAsync(ip -> {
|
future.thenApply(ip -> {
|
||||||
bot.logger.log(
|
bot.logger.log(
|
||||||
LogType.AUTH,
|
LogType.AUTH,
|
||||||
Component.translatable(
|
Component.translatable(
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class CorePlugin extends PositionPlugin.Listener {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Vector3i coreBlock = block;
|
final Vector3i coreBlock = block.clone();
|
||||||
|
|
||||||
run(command);
|
run(command);
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ public class CorePlugin extends PositionPlugin.Listener {
|
||||||
|
|
||||||
final CompletableFuture<String> future = bot.query.block(coreBlock, "LastOutput");
|
final CompletableFuture<String> future = bot.query.block(coreBlock, "LastOutput");
|
||||||
|
|
||||||
future.thenApplyAsync(output -> {
|
future.thenApply(output -> {
|
||||||
if (output == null) return null;
|
if (output == null) return null;
|
||||||
|
|
||||||
trackedFuture.complete(
|
trackedFuture.complete(
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class IPFilterPlugin extends PlayersPlugin.Listener {
|
||||||
|
|
||||||
if (future == null) return;
|
if (future == null) return;
|
||||||
|
|
||||||
future.thenApplyAsync(output -> {
|
future.thenApply(output -> {
|
||||||
handleFilterManager(output, target);
|
handleFilterManager(output, target);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
|
|
|
@ -156,7 +156,7 @@ public class PlayersDatabasePlugin extends PlayersPlugin.Listener {
|
||||||
|
|
||||||
if (future == null) return;
|
if (future == null) return;
|
||||||
|
|
||||||
future.thenApplyAsync(output -> {
|
future.thenApply(output -> {
|
||||||
if (output == null) return null;
|
if (output == null) return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class PlayersPlugin extends Bot.Listener {
|
||||||
|
|
||||||
trackedCoreFuture.completeOnTimeout(null, 5, TimeUnit.SECONDS);
|
trackedCoreFuture.completeOnTimeout(null, 5, TimeUnit.SECONDS);
|
||||||
|
|
||||||
trackedCoreFuture.thenApplyAsync(output -> {
|
trackedCoreFuture.thenApply(output -> {
|
||||||
final List<Component> children = output.children();
|
final List<Component> children = output.children();
|
||||||
|
|
||||||
String stringified = ComponentUtilities.stringify(Component.join(JoinConfiguration.separator(Component.empty()), 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) {
|
private void check (PlayerEntry target) {
|
||||||
final CompletableFuture<String> future = getLastKnownName(target.profile.getIdAsString());
|
final CompletableFuture<String> future = getLastKnownName(target.profile.getIdAsString());
|
||||||
|
|
||||||
future.thenApplyAsync(lastKnownName -> {
|
future.thenApply(lastKnownName -> {
|
||||||
if (lastKnownName == null) {
|
if (lastKnownName == null) {
|
||||||
list.remove(target);
|
list.remove(target);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class ServerPluginsManagerPlugin extends Bot.Listener {
|
||||||
public void connected (ConnectedEvent event) {
|
public void connected (ConnectedEvent event) {
|
||||||
final CompletableFuture<ClientboundCommandSuggestionsPacket> future = bot.tabComplete.tabComplete("ver ");
|
final CompletableFuture<ClientboundCommandSuggestionsPacket> future = bot.tabComplete.tabComplete("ver ");
|
||||||
|
|
||||||
future.thenApplyAsync((packet) -> {
|
future.thenApply((packet) -> {
|
||||||
final String[] matches = packet.getMatches();
|
final String[] matches = packet.getMatches();
|
||||||
|
|
||||||
// should i just use the plugins as the String array instead of a list?
|
// should i just use the plugins as the String array instead of a list?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue