A few command improvements

This commit is contained in:
Magnus Ulf 2019-01-02 00:43:39 +01:00
parent c955ddc552
commit 3827d2bf06
5 changed files with 11 additions and 8 deletions

View File

@ -25,6 +25,7 @@ public class CmdFactions extends FactionsCommand
public CmdFactionsList cmdFactionsList = new CmdFactionsList(); public CmdFactionsList cmdFactionsList = new CmdFactionsList();
public CmdFactionsFaction cmdFactionsFaction = new CmdFactionsFaction(); public CmdFactionsFaction cmdFactionsFaction = new CmdFactionsFaction();
public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer(); public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer();
public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus();
public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin(); public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin();
public CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave(); public CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave();
public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome(); public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome();
@ -43,7 +44,6 @@ public class CmdFactions extends FactionsCommand
public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk(); public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk();
public CmdFactionsSeeChunkOld cmdFactionsSeeChunkOld = new CmdFactionsSeeChunkOld(); public CmdFactionsSeeChunkOld cmdFactionsSeeChunkOld = new CmdFactionsSeeChunkOld();
public CmdFactionsTerritorytitles cmdFactionsTerritorytitles = new CmdFactionsTerritorytitles(); public CmdFactionsTerritorytitles cmdFactionsTerritorytitles = new CmdFactionsTerritorytitles();
public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus();
public CmdFactionsClaim cmdFactionsClaim = new CmdFactionsClaim(); public CmdFactionsClaim cmdFactionsClaim = new CmdFactionsClaim();
public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim(); public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim();
public CmdFactionsAccess cmdFactionsAccess = new CmdFactionsAccess(); public CmdFactionsAccess cmdFactionsAccess = new CmdFactionsAccess();

View File

@ -38,6 +38,9 @@ public class CmdFactionsPlayer extends FactionsCommand
// INFO: Title // INFO: Title
message(Txt.titleize("Player " + mplayer.describeTo(msender))); message(Txt.titleize("Player " + mplayer.describeTo(msender)));
// INFO: Rank
msg("<a>Rank: <v>%s", mplayer.getRank().getDisplayName(sender));
// INFO: Power (as progress bar) // INFO: Power (as progress bar)
double progressbarQuota = 0; double progressbarQuota = 0;
double playerPowerMax = mplayer.getPowerMax(); double playerPowerMax = mplayer.getPowerMax();

View File

@ -27,7 +27,7 @@ public class CmdFactionsRankEdit extends FactionsCommand
if (!msender.getRank().isLeader()) if (!msender.getRank().isLeader())
{ {
throw new MassiveException().addMsg("<b>Only the leader can create ranks."); throw new MassiveException().addMsg("<b>Only the leader can create, edit or delete ranks.");
} }
} }

View File

@ -18,9 +18,6 @@ public class CmdFactionsSethome extends FactionsCommandHome
public CmdFactionsSethome() public CmdFactionsSethome()
{ {
// Aliases
this.addAliases("sethome");
// Parameters // Parameters
this.addParameter(TypeFaction.get(), "faction", "you"); this.addParameter(TypeFaction.get(), "faction", "you");

View File

@ -20,7 +20,7 @@ public class CmdFactionsTitle extends FactionsCommand
{ {
// Parameters // Parameters
this.addParameter(TypeMPlayer.get(), "player"); this.addParameter(TypeMPlayer.get(), "player");
this.addParameter(TypeString.get(), "title", "", true); this.addParameter(TypeString.get(), "title", "none", true);
} }
// -------------------------------------------- // // -------------------------------------------- //
@ -46,8 +46,11 @@ public class CmdFactionsTitle extends FactionsCommand
// Rank Check // Rank Check
if (!msender.isOverriding() && you.getRank().isMoreThan(msender.getRank())) if (!msender.isOverriding() && you.getRank().isMoreThan(msender.getRank()))
{ {
msg("<b>You can not edit titles for higher ranks."); throw new MassiveException().addMsg("<b>You can not edit titles for higher ranks.");
return; }
if (!msender.isOverriding() && you.getRank() == msender.getRank())
{
throw new MassiveException().addMsg("<b>You can't edit titles of people with the same rank as yourself.");
} }
// Event // Event