mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Fix #timedTeleport returning FAILED_MOVING even if the warmup was bypassed or <=0
This commit is contained in:
1 parent
1c2f1134d2
commit
300a01a2c2
1 file changed
+6
-5
@@ -254,13 +254,14 @@ public class TeleportManager {
|
||||
return CompletableFuture.completedFuture(TeleportResult.FAILED_ALREADY_TELEPORTING);
|
||||
}
|
||||
|
||||
// Cancel if the player is already moving
|
||||
if (onlineUser.isMoving()) {
|
||||
return CompletableFuture.completedFuture(TeleportResult.FAILED_MOVING);
|
||||
}
|
||||
|
||||
final int teleportWarmupTime = plugin.getSettings().teleportWarmupTime;
|
||||
if (!onlineUser.hasPermission(Permission.BYPASS_TELEPORT_WARMUP.node) && teleportWarmupTime > 0) {
|
||||
// Cancel if the player is already moving
|
||||
if (onlineUser.isMoving()) {
|
||||
return CompletableFuture.completedFuture(TeleportResult.FAILED_MOVING);
|
||||
}
|
||||
|
||||
// Carry out the timed teleport
|
||||
final TimedTeleport timedTeleport = new TimedTeleport(onlineUser, position, teleportWarmupTime);
|
||||
return processTeleportWarmup(timedTeleport).thenApplyAsync(teleport -> {
|
||||
if (!teleport.cancelled) {
|
||||
|
||||
Reference in new issue
Block a user