Loads of UPlayer --> MPlayer renames
This commit is contained in:
@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.cmd.arg.ARUPlayer;
|
||||
import com.massivecraft.factions.cmd.arg.ARMPlayer;
|
||||
import com.massivecraft.factions.entity.MPlayer;
|
||||
import com.massivecraft.massivecore.Progressbar;
|
||||
import com.massivecraft.massivecore.cmd.req.ReqHasPerm;
|
||||
@ -37,24 +37,24 @@ public class CmdFactionsPlayer extends FCommand
|
||||
public void perform()
|
||||
{
|
||||
// Args
|
||||
MPlayer uplayer = this.arg(0, ARUPlayer.getAny(), usender);
|
||||
if (uplayer == null) return;
|
||||
MPlayer mplayer = this.arg(0, ARMPlayer.getAny(), usender);
|
||||
if (mplayer == null) return;
|
||||
|
||||
// INFO: Title
|
||||
msg(Txt.titleize(Txt.upperCaseFirst(uplayer.getUniverse()) + " Player " + uplayer.describeTo(usender)));
|
||||
msg(Txt.titleize(Txt.upperCaseFirst(mplayer.getUniverse()) + " Player " + mplayer.describeTo(usender)));
|
||||
|
||||
// INFO: Power (as progress bar)
|
||||
double progressbarQuota = uplayer.getPower() / uplayer.getPowerMax();
|
||||
int progressbarWidth = (int) Math.round(uplayer.getPowerMax() / uplayer.getPowerMaxUniversal() * 100);
|
||||
double progressbarQuota = mplayer.getPower() / mplayer.getPowerMax();
|
||||
int progressbarWidth = (int) Math.round(mplayer.getPowerMax() / mplayer.getPowerMaxUniversal() * 100);
|
||||
msg("<k>Power: <v>%s", Progressbar.HEALTHBAR_CLASSIC.withQuota(progressbarQuota).withWidth(progressbarWidth).render());
|
||||
|
||||
// INFO: Power (as digits)
|
||||
msg("<k>Power: <v>%.2f / %.2f", uplayer.getPower(), uplayer.getPowerMax());
|
||||
msg("<k>Power: <v>%.2f / %.2f", mplayer.getPower(), mplayer.getPowerMax());
|
||||
|
||||
// INFO: Power Boost
|
||||
if (uplayer.hasPowerBoost())
|
||||
if (mplayer.hasPowerBoost())
|
||||
{
|
||||
double powerBoost = uplayer.getPowerBoost();
|
||||
double powerBoost = mplayer.getPowerBoost();
|
||||
String powerBoostType = (powerBoost > 0 ? "bonus" : "penalty");
|
||||
msg("<k>Power Boost: <v>%f <i>(a manually granted %s)", powerBoost, powerBoostType);
|
||||
}
|
||||
@ -63,20 +63,20 @@ public class CmdFactionsPlayer extends FCommand
|
||||
// If the player is not at maximum we wan't to display how much time left.
|
||||
|
||||
String stringTillMax = "";
|
||||
double powerTillMax = uplayer.getPowerMax() - uplayer.getPower();
|
||||
double powerTillMax = mplayer.getPowerMax() - mplayer.getPower();
|
||||
if (powerTillMax > 0)
|
||||
{
|
||||
long millisTillMax = (long) (powerTillMax * TimeUnit.MILLIS_PER_HOUR / uplayer.getPowerPerHour());
|
||||
long millisTillMax = (long) (powerTillMax * TimeUnit.MILLIS_PER_HOUR / mplayer.getPowerPerHour());
|
||||
LinkedHashMap<TimeUnit, Long> unitcountsTillMax = TimeDiffUtil.unitcounts(millisTillMax, TimeUnit.getAllButMillis());
|
||||
unitcountsTillMax = TimeDiffUtil.limit(unitcountsTillMax, 2);
|
||||
String unitcountsTillMaxFormated = TimeDiffUtil.formatedVerboose(unitcountsTillMax, "<i>");
|
||||
stringTillMax = Txt.parse(" <i>(%s <i>left till max)", unitcountsTillMaxFormated);
|
||||
}
|
||||
|
||||
msg("<k>Power per Hour: <v>%.2f%s", uplayer.getPowerPerHour(), stringTillMax);
|
||||
msg("<k>Power per Hour: <v>%.2f%s", mplayer.getPowerPerHour(), stringTillMax);
|
||||
|
||||
// INFO: Power per Death
|
||||
msg("<k>Power per Death: <v>%.2f", uplayer.getPowerPerDeath());
|
||||
msg("<k>Power per Death: <v>%.2f", mplayer.getPowerPerDeath());
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user