mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 14:38:53 +00:00
feat: add permission-based teleport warmup (#682)
* Add permission based tp cooldowns * Add permission based tp cooldowns * Move permission warmup logic to OnlineUser
This commit is contained in:
1 parent
de070e0c84
commit
ecc180eb88
2 files changed
+15
-1
No files matched your search
@@ -66,7 +66,7 @@ public class TeleportBuilder {
|
|||||||
|
|
||||||
return new TimedTeleport(
|
return new TimedTeleport(
|
||||||
executor, onlineTeleporter, target, type,
|
executor, onlineTeleporter, target, type,
|
||||||
plugin.getSettings().getGeneral().getTeleportWarmupTime(),
|
onlineTeleporter.getMaxTeleportWarmup(plugin.getSettings().getGeneral().getTeleportWarmupTime()),
|
||||||
updateLastPosition, actions, plugin
|
updateLastPosition, actions, plugin
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,6 +260,20 @@ public abstract class OnlineUser extends User implements Teleportable, CommandUs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the largest permission node value for teleport warmup.
|
||||||
|
*
|
||||||
|
* @param defaultTeleportWarmup the default teleport warmup time, if no perms are set
|
||||||
|
* @return the largest permission node value for teleport warmup
|
||||||
|
*/
|
||||||
|
public int getMaxTeleportWarmup(final int defaultTeleportWarmup) {
|
||||||
|
final List<Integer> homes = getNumericalPermissions("huskhomes.teleport_warmup.");
|
||||||
|
if (homes.isEmpty()) {
|
||||||
|
return defaultTeleportWarmup;
|
||||||
|
}
|
||||||
|
return homes.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of free home slots this user may set.
|
* Get the number of free home slots this user may set.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in new issue
Block a user