Factions/src/com/massivecraft/factions/commands/CmdPower.java

42 lines
1.1 KiB
Java
Raw Normal View History

package com.massivecraft.factions.commands;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
2011-10-09 18:35:39 +02:00
import com.massivecraft.factions.struct.Permission;
2011-10-09 20:10:19 +02:00
public class CmdPower extends FCommand
2011-10-09 18:35:39 +02:00
{
2011-10-09 20:10:19 +02:00
public CmdPower()
2011-10-09 18:35:39 +02:00
{
super();
this.aliases.add("power");
this.aliases.add("pow");
2011-10-09 18:35:39 +02:00
//this.requiredArgs.add("faction tag");
this.optionalArgs.put("player name", "you");
2011-10-09 18:35:39 +02:00
this.permission = Permission.COMMAND_POWER.node;
2011-10-09 18:35:39 +02:00
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeModerator = false;
senderMustBeAdmin = false;
}
@Override
2011-10-09 18:35:39 +02:00
public void perform()
{
FPlayer target = this.argAsBestFPlayerMatch(0, fme);
if (target == null) return;
if (target != me && ! Permission.COMMAND_POWER_ANY.has(sender, true)) return;
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
2011-10-09 18:35:39 +02:00
if ( ! payForCommand(Conf.econCostPower)) return;
2011-10-09 18:35:39 +02:00
sendMessageParsed("%s<a> - Power / Maxpower: <i>%d / %d", target.getNameAndRelevant(fme), target.getPowerRounded(), target.getPowerMaxRounded());
}
}