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

View File

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