Renaming show --> faction and power --> player
This commit is contained in:
@ -13,7 +13,7 @@ public enum Perm
|
||||
ACCESS("access"),
|
||||
ACCESS_ANY("access.any"),
|
||||
ACCESS_VIEW("access.view"),
|
||||
ADMIN("adminmode"),
|
||||
ADMIN("admin"),
|
||||
AUTOCLAIM("autoclaim"),
|
||||
CLAIM("claim"),
|
||||
CLAIM_RADIUS("claim.radius"),
|
||||
@ -21,6 +21,7 @@ public enum Perm
|
||||
DEMOTE("demote"),
|
||||
DESCRIPTION("description"),
|
||||
DISBAND("disband"),
|
||||
FACTION("faction"),
|
||||
FLAG("flag"),
|
||||
FLAG_SET("flag.set"),
|
||||
HOME("home"),
|
||||
@ -45,15 +46,12 @@ public enum Perm
|
||||
OFFICER_ANY("officer.any"),
|
||||
OPEN("open"),
|
||||
PERM("perm"),
|
||||
POWER("power"),
|
||||
POWER_ANY("power.any"),
|
||||
PLAYER("player"),
|
||||
POWERBOOST("powerboost"),
|
||||
PROMOTE("promote"),
|
||||
RELATION("relation"),
|
||||
SAVE("save"),
|
||||
SEE_CHUNK("seechunk"),
|
||||
SETHOME("sethome"),
|
||||
SHOW("show"),
|
||||
NAME("name"),
|
||||
TITLE("title"),
|
||||
TITLE_COLOR("title.color"),
|
||||
|
@ -19,6 +19,7 @@ public class CmdFactions extends FCommand
|
||||
public CmdFactionsDemote cmdFactionsDemote = new CmdFactionsDemote();
|
||||
public CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription();
|
||||
public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband();
|
||||
public CmdFactionsFaction cmdFactionsFaction = new CmdFactionsFaction();
|
||||
public CmdFactionsFlag cmdFactionsFlag = new CmdFactionsFlag();
|
||||
public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome();
|
||||
public CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite();
|
||||
@ -31,7 +32,7 @@ public class CmdFactions extends FCommand
|
||||
public CmdFactionsMoney cmdFactionsMoney = new CmdFactionsMoney();
|
||||
public CmdFactionsOpen cmdFactionsOpen = new CmdFactionsOpen();
|
||||
public CmdFactionsPerm cmdFactionsPerm = new CmdFactionsPerm();
|
||||
public CmdFactionsPower cmdFactionsPower = new CmdFactionsPower();
|
||||
public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer();
|
||||
public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost();
|
||||
public CmdFactionsPromote cmdFactionsPromote = new CmdFactionsPromote();
|
||||
public CmdFactionsRelationAlly cmdFactionsRelationAlly = new CmdFactionsRelationAlly();
|
||||
@ -40,7 +41,6 @@ public class CmdFactions extends FCommand
|
||||
public CmdFactionsRelationTruce cmdFactionsRelationTruce = new CmdFactionsRelationTruce();
|
||||
public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk();
|
||||
public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome();
|
||||
public CmdFactionsShow cmdFactionsShow = new CmdFactionsShow();
|
||||
public CmdFactionsName cmdFactionsName = new CmdFactionsName();
|
||||
public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle();
|
||||
public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim();
|
||||
@ -61,8 +61,8 @@ public class CmdFactions extends FCommand
|
||||
|
||||
this.addSubCommand(HelpCommand.get());
|
||||
this.addSubCommand(this.cmdFactionsList);
|
||||
this.addSubCommand(this.cmdFactionsShow);
|
||||
this.addSubCommand(this.cmdFactionsPower);
|
||||
this.addSubCommand(this.cmdFactionsFaction);
|
||||
this.addSubCommand(this.cmdFactionsPlayer);
|
||||
this.addSubCommand(this.cmdFactionsJoin);
|
||||
this.addSubCommand(this.cmdFactionsLeave);
|
||||
this.addSubCommand(this.cmdFactionsHome);
|
||||
|
@ -24,16 +24,16 @@ import com.massivecraft.mcore.util.TimeDiffUtil;
|
||||
import com.massivecraft.mcore.util.TimeUnit;
|
||||
import com.massivecraft.mcore.util.Txt;
|
||||
|
||||
public class CmdFactionsShow extends FCommand
|
||||
public class CmdFactionsFaction extends FCommand
|
||||
{
|
||||
public CmdFactionsShow()
|
||||
public CmdFactionsFaction()
|
||||
{
|
||||
this.addAliases("s", "show", "who");
|
||||
this.addAliases("f", "faction");
|
||||
|
||||
this.addOptionalArg("faction", "you");
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.SHOW.node));
|
||||
this.addRequirements(ReqHasPerm.get(Perm.FACTION.node));
|
||||
}
|
||||
|
||||
@Override
|
@ -62,6 +62,12 @@ public class CmdFactionsPerm extends FCommand
|
||||
Rel rel = this.arg(2, ARRel.get());
|
||||
if (rel == null) return;
|
||||
|
||||
if (!this.argIsSet(3))
|
||||
{
|
||||
msg("<b>Should <h>%s <b>have the <h>%s <b>permission or not?\nYou must <h>add \"yes\" or \"no\" <b>at the end.", Txt.getNicedEnum(rel), Txt.getNicedEnum(perm));
|
||||
return;
|
||||
}
|
||||
|
||||
Boolean val = this.arg(3, ARBoolean.get(), null);
|
||||
if (val == null) return;
|
||||
|
||||
|
@ -6,16 +6,16 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
|
||||
import com.massivecraft.factions.entity.UPlayer;
|
||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
|
||||
|
||||
public class CmdFactionsPower extends FCommand
|
||||
public class CmdFactionsPlayer extends FCommand
|
||||
{
|
||||
public CmdFactionsPower()
|
||||
public CmdFactionsPlayer()
|
||||
{
|
||||
this.addAliases("power", "pow");
|
||||
this.addAliases("p", "player");
|
||||
|
||||
this.addOptionalArg("player", "you");
|
||||
|
||||
this.addRequirements(ReqFactionsEnabled.get());
|
||||
this.addRequirements(ReqHasPerm.get(Perm.POWER.node));
|
||||
this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -25,8 +25,7 @@ public class CmdFactionsPower extends FCommand
|
||||
UPlayer target = this.arg(0, ARUPlayer.getStartAny(sender), usender);
|
||||
if (target == null) return;
|
||||
|
||||
// Perm
|
||||
if (target != usender && ! Perm.POWER_ANY.has(sender, true)) return;
|
||||
// TODO: Print info
|
||||
|
||||
double powerBoost = target.getPowerBoost();
|
||||
String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? " (bonus: " : " (penalty: ") + powerBoost + ")";
|
@ -643,6 +643,7 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
|
||||
{
|
||||
Entry<FPerm, Set<Rel>> entry = iter.next();
|
||||
FPerm key = entry.getKey();
|
||||
if (key == null) System.out.println("key was null");
|
||||
Set<Rel> keyDefault = key.getDefault(this);
|
||||
Set<Rel> value = entry.getValue();
|
||||
|
||||
|
Reference in New Issue
Block a user