2018-04-18 03:01:53 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.Conf;
|
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdLowPower extends FCommand {
|
|
|
|
|
2018-07-12 18:11:07 +02:00
|
|
|
public CmdLowPower() {
|
2018-04-18 03:01:53 +02:00
|
|
|
super();
|
|
|
|
this.aliases.add("lowpower");
|
|
|
|
|
|
|
|
|
|
|
|
this.disableOnLock = false;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = true;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeColeader = true;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2018-07-12 18:11:07 +02:00
|
|
|
public void perform() {
|
2018-04-18 03:01:53 +02:00
|
|
|
double maxPower = Conf.powerPlayerMax;
|
|
|
|
String format = TL.COMMAND_LOWPOWER_FORMAT.toString();
|
2018-07-12 18:11:07 +02:00
|
|
|
msg(TL.COMMAND_LOWPOWER_HEADER.toString().replace("{maxpower}", (int) maxPower + ""));
|
|
|
|
for (FPlayer fPlayer : fme.getFaction().getFPlayers()) {
|
|
|
|
if (fPlayer.getPower() < maxPower) {
|
|
|
|
sendMessage(format.replace("{player}", fPlayer.getName()).replace("{player_power}", (int) fPlayer.getPower() + "").replace("{maxpower}", (int) maxPower + ""));
|
2018-04-18 03:01:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_LOWPOWER_DESCRIPTION;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|