From 3827d2bf060fe90b19add7a8c3f82d9d46a013e3 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Wed, 2 Jan 2019 00:43:39 +0100 Subject: [PATCH] A few command improvements --- src/com/massivecraft/factions/cmd/CmdFactions.java | 2 +- src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java | 3 +++ .../massivecraft/factions/cmd/CmdFactionsRankEdit.java | 2 +- .../massivecraft/factions/cmd/CmdFactionsSethome.java | 3 --- src/com/massivecraft/factions/cmd/CmdFactionsTitle.java | 9 ++++++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactions.java b/src/com/massivecraft/factions/cmd/CmdFactions.java index 9b19529d..7fc1f4f5 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactions.java +++ b/src/com/massivecraft/factions/cmd/CmdFactions.java @@ -25,6 +25,7 @@ public class CmdFactions extends FactionsCommand public CmdFactionsList cmdFactionsList = new CmdFactionsList(); public CmdFactionsFaction cmdFactionsFaction = new CmdFactionsFaction(); public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer(); + public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus(); public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin(); public CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave(); public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome(); @@ -43,7 +44,6 @@ public class CmdFactions extends FactionsCommand public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk(); public CmdFactionsSeeChunkOld cmdFactionsSeeChunkOld = new CmdFactionsSeeChunkOld(); public CmdFactionsTerritorytitles cmdFactionsTerritorytitles = new CmdFactionsTerritorytitles(); - public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus(); public CmdFactionsClaim cmdFactionsClaim = new CmdFactionsClaim(); public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim(); public CmdFactionsAccess cmdFactionsAccess = new CmdFactionsAccess(); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java index 9d234367..61f08e05 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPlayer.java @@ -37,6 +37,9 @@ public class CmdFactionsPlayer extends FactionsCommand // INFO: Title message(Txt.titleize("Player " + mplayer.describeTo(msender))); + + // INFO: Rank + msg("Rank: %s", mplayer.getRank().getDisplayName(sender)); // INFO: Power (as progress bar) double progressbarQuota = 0; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRankEdit.java b/src/com/massivecraft/factions/cmd/CmdFactionsRankEdit.java index 3f12b6e6..66af160c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRankEdit.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRankEdit.java @@ -27,7 +27,7 @@ public class CmdFactionsRankEdit extends FactionsCommand if (!msender.getRank().isLeader()) { - throw new MassiveException().addMsg("Only the leader can create ranks."); + throw new MassiveException().addMsg("Only the leader can create, edit or delete ranks."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java index 7f24c8de..b52671bf 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java @@ -18,9 +18,6 @@ public class CmdFactionsSethome extends FactionsCommandHome public CmdFactionsSethome() { - // Aliases - this.addAliases("sethome"); - // Parameters this.addParameter(TypeFaction.get(), "faction", "you"); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java index 37a99912..e9a1755b 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java @@ -20,7 +20,7 @@ public class CmdFactionsTitle extends FactionsCommand { // Parameters 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 if (!msender.isOverriding() && you.getRank().isMoreThan(msender.getRank())) { - msg("You can not edit titles for higher ranks."); - return; + throw new MassiveException().addMsg("You can not edit titles for higher ranks."); + } + if (!msender.isOverriding() && you.getRank() == msender.getRank()) + { + throw new MassiveException().addMsg("You can't edit titles of people with the same rank as yourself."); } // Event