Fix incomplete cooldowns being added to data (#4249)

This commit is contained in:
Josh Roy 2021-06-18 19:28:10 -04:00 committed by GitHub
parent 1da3b3f08e
commit 003d556f3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -601,6 +601,9 @@ public abstract class UserData extends PlayerExtension implements IConf {
final CommandCooldown cooldown = new CommandCooldown();
cooldown.pattern(pattern);
cooldown.value(expiresAt.getTime());
if (cooldown.isIncomplete()) {
return;
}
holder.timestamps().commandCooldowns().add(cooldown);
if (save) {
save();