mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
New API methods, refactor position object to use static creators
This commit is contained in:
1 parent
42adc13425
commit
6b8c515b61
42 files changed
+587
-232
No files matched your search
@@ -64,13 +64,14 @@ public class RtpCommand extends Command {
|
||||
.orElseThrow(() -> new IllegalStateException("No user data found for " + teleporter.getUsername()));
|
||||
final Instant currentTime = Instant.now();
|
||||
if (executor.equals(teleporter) && !currentTime.isAfter(user.getRtpCooldown()) &&
|
||||
!executor.hasPermission(getPermission("bypass_cooldown"))) {
|
||||
!executor.hasPermission(getPermission("bypass_cooldown"))) {
|
||||
plugin.getLocales().getLocale("error_rtp_cooldown",
|
||||
Long.toString(currentTime.until(user.getRtpCooldown(), ChronoUnit.MINUTES) + 1))
|
||||
.ifPresent(executor::sendMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// Generate a random position
|
||||
plugin.getLocales().getLocale("teleporting_random_generation")
|
||||
.ifPresent(teleporter::sendMessage);
|
||||
final Optional<Position> position = plugin.getRandomTeleportEngine()
|
||||
|
||||
Reference in new issue
Block a user