mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 14:38:53 +00:00
Fix warmup set at 0 not being respected, close #260
This commit is contained in:
1 parent
54b517121b
commit
a5ffd223cf
1 file changed
+6
-6
@@ -30,7 +30,7 @@ public class TimedTeleport extends Teleport {
|
||||
this.plugin = plugin;
|
||||
this.startLocation = teleporter.getPosition();
|
||||
this.startHealth = teleporter.getHealth();
|
||||
this.timeLeft = warmupTime;
|
||||
this.timeLeft = Math.max(warmupTime, 0);
|
||||
this.teleporter = teleporter;
|
||||
}
|
||||
|
||||
@@ -47,17 +47,17 @@ public class TimedTeleport extends Teleport {
|
||||
.thenApply(resultState -> CompletedTeleport.from(resultState, this));
|
||||
}
|
||||
|
||||
// Check if the teleporter can bypass warmup
|
||||
if (timeLeft == 0 || teleporter.hasPermission(Permission.BYPASS_TELEPORT_WARMUP.node)) {
|
||||
return super.execute();
|
||||
}
|
||||
|
||||
// Check if the teleporter is already warming up to teleport
|
||||
if (plugin.getCache().currentlyOnWarmup.contains(teleporter.uuid)) {
|
||||
return CompletableFuture.completedFuture(TeleportResult.FAILED_ALREADY_TELEPORTING)
|
||||
.thenApply(resultState -> CompletedTeleport.from(resultState, this));
|
||||
}
|
||||
|
||||
// Check if the teleporter can bypass warmup
|
||||
if (teleporter.hasPermission(Permission.BYPASS_TELEPORT_WARMUP.node)) {
|
||||
return super.execute();
|
||||
}
|
||||
|
||||
// Check economy actions
|
||||
for (Settings.EconomyAction economyAction : economyActions) {
|
||||
if (!plugin.validateEconomyCheck(executor, economyAction)) {
|
||||
|
||||
Reference in new issue
Block a user