mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 22:16:34 +00:00
De-nest futures on teleport and timedTeleport, fix crash, tweak SpawnCommand logic
This commit is contained in:
1 parent
4832d69131
commit
973ae90905
4 files changed
+43
-48
No files matched your search
@@ -261,19 +261,19 @@ public class TeleportManager {
|
||||
|
||||
final int teleportWarmupTime = plugin.getSettings().teleportWarmupTime;
|
||||
if (!onlineUser.hasPermission(Permission.BYPASS_TELEPORT_WARMUP.node) && teleportWarmupTime > 0) {
|
||||
return CompletableFuture.supplyAsync(() -> processTeleportWarmup(new TimedTeleport(onlineUser, position, teleportWarmupTime))
|
||||
.thenApply(teleport -> {
|
||||
if (!teleport.cancelled) {
|
||||
for (final Settings.EconomyAction action : economyActions) {
|
||||
if (!plugin.validateEconomyCheck(onlineUser, action)) {
|
||||
return TeleportResult.CANCELLED;
|
||||
}
|
||||
}
|
||||
return teleport(onlineUser, position).join();
|
||||
} else {
|
||||
final TimedTeleport timedTeleport = new TimedTeleport(onlineUser, position, teleportWarmupTime);
|
||||
return processTeleportWarmup(timedTeleport).thenApplyAsync(teleport -> {
|
||||
if (!teleport.cancelled) {
|
||||
for (final Settings.EconomyAction action : economyActions) {
|
||||
if (!plugin.validateEconomyCheck(onlineUser, action)) {
|
||||
return TeleportResult.CANCELLED;
|
||||
}
|
||||
}).join());
|
||||
}
|
||||
return teleport(onlineUser, position).join();
|
||||
} else {
|
||||
return TeleportResult.CANCELLED;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return teleport(onlineUser, position);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user