mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Fix rtp cooldown not working, close #224
This commit is contained in:
1 parent
7fabf8fc6f
commit
c2661a7017
1 file changed
+3
-4
@@ -61,9 +61,8 @@ public class RtpCommand extends CommandBase implements ConsoleExecutable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Instant currentTime = Instant.now();
|
final Instant currentTime = Instant.now();
|
||||||
if (!isExecutorTeleporting
|
if (isExecutorTeleporting && !currentTime.isAfter(userData.get().rtpCooldown())
|
||||||
&& !currentTime.isAfter(userData.get().rtpCooldown())
|
&& !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
||||||
&& !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
|
||||||
plugin.getLocales().getLocale("error_rtp_cooldown",
|
plugin.getLocales().getLocale("error_rtp_cooldown",
|
||||||
Long.toString(currentTime.until(userData.get().rtpCooldown(), ChronoUnit.MINUTES)))
|
Long.toString(currentTime.until(userData.get().rtpCooldown(), ChronoUnit.MINUTES)))
|
||||||
.ifPresent(onlineUser::sendMessage);
|
.ifPresent(onlineUser::sendMessage);
|
||||||
@@ -83,7 +82,7 @@ public class RtpCommand extends CommandBase implements ConsoleExecutable {
|
|||||||
: plugin.getTeleportManager().teleport(userToTeleport, position.get());
|
: plugin.getTeleportManager().teleport(userToTeleport, position.get());
|
||||||
randomTeleport.thenAccept(result -> {
|
randomTeleport.thenAccept(result -> {
|
||||||
if (isExecutorTeleporting &&
|
if (isExecutorTeleporting &&
|
||||||
result.successful && !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
result.successful && !onlineUser.hasPermission(Permission.BYPASS_RTP_COOLDOWN.node)) {
|
||||||
plugin.getDatabase().updateUserData(new UserData(onlineUser,
|
plugin.getDatabase().updateUserData(new UserData(onlineUser,
|
||||||
userData.get().homeSlots(), userData.get().ignoringTeleports(),
|
userData.get().homeSlots(), userData.get().ignoringTeleports(),
|
||||||
Instant.now().plus(plugin.getSettings().rtpCooldownLength, ChronoUnit.MINUTES)));
|
Instant.now().plus(plugin.getSettings().rtpCooldownLength, ChronoUnit.MINUTES)));
|
||||||
|
|||||||
Reference in new issue
Block a user