2012-01-28 18:56:51 +01:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
2013-04-09 13:00:09 +02:00
|
|
|
import com.massivecraft.factions.Factions;
|
2013-04-09 12:56:29 +02:00
|
|
|
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;
|
2012-01-28 18:56:51 +01:00
|
|
|
|
2013-04-10 13:12:22 +02:00
|
|
|
public class CmdFactionsPowerBoost extends FCommand
|
2012-01-28 18:56:51 +01:00
|
|
|
{
|
2013-04-10 13:12:22 +02:00
|
|
|
public CmdFactionsPowerBoost()
|
2012-01-28 18:56:51 +01:00
|
|
|
{
|
2013-04-16 10:11:59 +02:00
|
|
|
this.addAliases("powerboost");
|
2012-01-28 18:56:51 +01:00
|
|
|
|
2013-04-23 12:14:36 +02:00
|
|
|
this.addRequiredArg("faction");
|
|
|
|
this.addRequiredArg("amount");
|
2012-01-28 18:56:51 +01:00
|
|
|
|
2013-04-16 10:11:59 +02:00
|
|
|
this.addRequirements(ReqHasPerm.get(Perm.POWERBOOST.node));
|
2012-01-28 18:56:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform()
|
|
|
|
{
|
2013-04-23 12:14:36 +02:00
|
|
|
Faction faction = this.arg(0, ARFaction.get(fme));
|
|
|
|
if (faction == null) return;
|
2012-01-28 18:56:51 +01:00
|
|
|
|
2013-04-23 12:14:36 +02:00
|
|
|
Double amount = this.arg(1, ARDouble.get());
|
|
|
|
if (amount == null) return;
|
2012-01-28 18:56:51 +01:00
|
|
|
|
2013-04-23 12:14:36 +02:00
|
|
|
faction.setPowerBoost(amount);
|
|
|
|
|
2013-04-24 19:01:17 +02:00
|
|
|
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?
|
2013-04-24 19:01:17 +02:00
|
|
|
Factions.get().log(fme.getName()+" has set the power bonus/penalty for "+faction.getName()+" to "+amount+".");
|
2012-01-28 18:56:51 +01:00
|
|
|
}
|
|
|
|
}
|