mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-02 13:31:43 +01:00
Use new API
This commit is contained in:
parent
dc72f7526c
commit
d5667e53f5
@ -221,7 +221,7 @@ public class CommandTrait extends Trait {
|
||||
}
|
||||
|
||||
private static class PlayerNPCCommand {
|
||||
@Persist
|
||||
@Persist(valueType = Long.class)
|
||||
Map<String, Long> lastUsed = Maps.newHashMap();
|
||||
@Persist
|
||||
Map<String, Integer> nUsed = Maps.newHashMap();
|
||||
@ -241,8 +241,7 @@ public class CommandTrait extends Trait {
|
||||
}
|
||||
long currentTimeSec = System.currentTimeMillis() / 1000;
|
||||
if (lastUsed.containsKey(command.command)) {
|
||||
if (currentTimeSec < ((Number) (lastUsed.get(command.command)
|
||||
+ ((Number) command.cooldown).longValue())).longValue()) {
|
||||
if (currentTimeSec < lastUsed.get(command.command) + command.cooldown) {
|
||||
return false;
|
||||
}
|
||||
lastUsed.remove(command.command);
|
||||
|
Loading…
Reference in New Issue
Block a user