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

@@ -28,7 +28,7 @@ public class CmdDisband extends FCommand {
this.permission = Permission.DISBAND.node;
this.disableOnLock = true;
this.disableOnSpam = true;
senderMustBePlayer = false;
senderMustBeMember = false;
@@ -46,6 +46,12 @@ public class CmdDisband extends FCommand {
return;
}
if (!fme.isCooldownEnded("disband")) {
fme.msg(TL.COMMAND_ONCOOOLDOWN, fme.getCooldown("disband"));
return;
}
boolean isMyFaction = fme != null && faction == myFaction;
if (isMyFaction) {
@@ -89,6 +95,7 @@ public class CmdDisband extends FCommand {
UtilFly.checkFly(this.fme, Board.getInstance().getFactionAt(new FLocation(follower)));
if (follower.getFaction() == faction) {
follower.msg(TL.COMMAND_DISBAND_BROADCAST_YOURS, amountString);
fme.setCooldown("disband", System.currentTimeMillis() + (SavageFactions.plugin.getConfig().getInt("fcooldowns.f-disband") * 1000));
} else {
follower.msg(TL.COMMAND_DISBAND_BROADCAST_NOTYOURS, amountString, faction.getTag(follower));
}