Factions/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java

39 lines
1.1 KiB
Java
Raw Normal View History

package com.massivecraft.factions.cmd;
2013-04-09 13:00:09 +02:00
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm;
2013-04-16 11:27:03 +02:00
import com.massivecraft.factions.cmd.arg.ARFaction;
2013-04-22 09:37:53 +02:00
import com.massivecraft.factions.entity.Faction;
2013-04-16 11:27:03 +02:00
import com.massivecraft.mcore.cmd.arg.ARDouble;
2013-04-16 10:11:59 +02:00
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
2013-04-10 13:12:22 +02:00
public class CmdFactionsPowerBoost extends FCommand
{
2013-04-10 13:12:22 +02:00
public CmdFactionsPowerBoost()
{
2013-04-16 10:11:59 +02:00
this.addAliases("powerboost");
2013-04-23 12:14:36 +02:00
this.addRequiredArg("faction");
this.addRequiredArg("amount");
2013-04-16 10:11:59 +02:00
this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node));
}
@Override
public void perform()
{
Faction faction = this.arg(0, ARFaction.get(usender));
2013-04-23 12:14:36 +02:00
if (faction == null) return;
2013-04-23 12:14:36 +02:00
Double amount = this.arg(1, ARDouble.get());
if (amount == null) return;
2013-04-23 12:14:36 +02:00
faction.setPowerBoost(amount);
msg("<i>"+faction.getName()+" now has a power bonus/penalty of "+amount+" to min and max power levels.");
2013-04-23 12:14:36 +02:00
// TODO: Inconsistent. Why is there no boolean to toggle this logging of?
Factions.get().log(usender.getName()+" has set the power bonus/penalty for "+faction.getName()+" to "+amount+".");
}
}