Cooldown and F Spam System Implemented

This commit is contained in:
Driftay
2019-06-02 14:28:42 -04:00
parent 4833cafa0e
commit 420d8e3321
25 changed files with 150 additions and 395 deletions

View File

@@ -24,6 +24,7 @@ public class CmdCreate extends FCommand {
this.permission = Permission.CREATE.node;
this.disableOnLock = true;
this.disableOnSpam = true;
senderMustBePlayer = true;
senderMustBeMember = false;
@@ -41,6 +42,11 @@ public class CmdCreate extends FCommand {
return;
}
if (!fme.isCooldownEnded("create")) {
fme.msg(TL.COMMAND_ONCOOOLDOWN, fme.getCooldown("create"));
return;
}
if (Factions.getInstance().isTagTaken(tag)) {
msg(TL.COMMAND_CREATE_INUSE);
return;
@@ -108,6 +114,9 @@ public class CmdCreate extends FCommand {
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
this.fme.msg(TL.COMMAND_PAYPALSET_CREATED);
}
fme.setCooldown("create", System.currentTimeMillis() + (SavageFactions.plugin.getConfig().getInt("fcooldowns.f-create") * 1000));
if (Conf.useCustomDefaultPermissions) {
faction.setDefaultPerms();
if (Conf.usePermissionHints)