9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 19:19:07 +00:00

Merge pull request #659 from CocoTheOwner/pickOptionForConsol,e

option picking auto-pick nr1 for consoles
This commit is contained in:
Dan
2021-09-25 13:50:30 -04:00
committed by GitHub
2 changed files with 38 additions and 9 deletions

View File

@@ -34,6 +34,7 @@ import com.volmit.iris.util.decree.exceptions.DecreeParsingException;
import com.volmit.iris.util.decree.exceptions.DecreeWhichException;
import com.volmit.iris.util.format.C;
import com.volmit.iris.util.format.Form;
import com.volmit.iris.util.parallel.MultiBurst;
import com.volmit.iris.util.plugin.CommandDummy;
import com.volmit.iris.util.plugin.VolmitSender;
import com.volmit.iris.util.scheduling.ChronoLatch;
@@ -528,18 +529,28 @@ public class VirtualDecreeCommand {
m++;
}
CompletableFuture<String> future = new CompletableFuture<>();
Iris.service(CommandSVC.class).post(password, future);
if (sender.isPlayer()) {
CompletableFuture<String> future = new CompletableFuture<>();
Iris.service(CommandSVC.class).post(password, future);
if (IrisSettings.get().getGeneral().isCommandSounds() && sender.isPlayer()) {
(sender.player()).playSound((sender.player()).getLocation(), Sound.BLOCK_AMETHYST_CLUSTER_BREAK, 0.77f, 0.65f);
(sender.player()).playSound((sender.player()).getLocation(), Sound.BLOCK_BEACON_DEACTIVATE, 0.125f, 1.99f);
}
if (IrisSettings.get().getGeneral().isCommandSounds()) {
(sender.player()).playSound((sender.player()).getLocation(), Sound.BLOCK_AMETHYST_CLUSTER_BREAK, 0.77f, 0.65f);
(sender.player()).playSound((sender.player()).getLocation(), Sound.BLOCK_BEACON_DEACTIVATE, 0.125f, 1.99f);
}
try {
return future.get(15, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
try {
return future.get(15, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException ignored) {
}
} else {
CompletableFuture<String> future = new CompletableFuture<>();
Iris.service(CommandSVC.class).postConsole(future);
try {
return future.get(15, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException ignored) {
}
}
return null;