2013-04-25 17:17:23 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.Perm;
|
|
|
|
import com.massivecraft.factions.cmd.arg.ARUPlayer;
|
|
|
|
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
|
|
|
import com.massivecraft.factions.entity.UPlayer;
|
|
|
|
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
|
|
|
|
2013-04-26 14:01:28 +02:00
|
|
|
public class CmdFactionsPlayer extends FCommand
|
2013-04-25 17:17:23 +02:00
|
|
|
{
|
2013-04-26 14:01:28 +02:00
|
|
|
public CmdFactionsPlayer()
|
2013-04-25 17:17:23 +02:00
|
|
|
{
|
2013-04-26 14:01:28 +02:00
|
|
|
this.addAliases("p", "player");
|
2013-04-25 17:17:23 +02:00
|
|
|
|
|
|
|
this.addOptionalArg("player", "you");
|
|
|
|
|
|
|
|
this.addRequirements(ReqFactionsEnabled.get());
|
2013-04-26 14:01:28 +02:00
|
|
|
this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node));
|
2013-04-25 17:17:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform()
|
|
|
|
{
|
|
|
|
// Args
|
|
|
|
UPlayer target = this.arg(0, ARUPlayer.getStartAny(sender), usender);
|
|
|
|
if (target == null) return;
|
|
|
|
|
2013-04-26 14:01:28 +02:00
|
|
|
// TODO: Print info
|
2013-04-25 17:17:23 +02:00
|
|
|
|
|
|
|
double powerBoost = target.getPowerBoost();
|
|
|
|
String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? " (bonus: " : " (penalty: ") + powerBoost + ")";
|
|
|
|
|
|
|
|
msg("%s<a> - Power / Maxpower: <i>%.2f / %.2f %s", target.describeTo(usender, true), target.getPower(), target.getPowerMax(), boost);
|
|
|
|
}
|
|
|
|
}
|