Renaming show --> faction and power --> player

This commit is contained in:
Olof Larsson 2013-04-26 14:01:28 +02:00
parent 7cbc99bdd6
commit 1609a7cfea
7 changed files with 32 additions and 31 deletions

View File

@ -13,7 +13,7 @@ permissions:
factions.access: {description: grant territory access, with the proper fperm, default: false} factions.access: {description: grant territory access, with the proper fperm, default: false}
factions.access.any: {description: grant territory access for another faction, default: false} factions.access.any: {description: grant territory access for another faction, default: false}
factions.access.view: {description: view territory access, default: false} factions.access.view: {description: view territory access, default: false}
factions.adminmode: {description: enable adminmode, default: false} factions.admin: {description: enable adminmode, default: false}
factions.autoclaim: {description: autoclaim when walking, default: false} factions.autoclaim: {description: autoclaim when walking, default: false}
factions.claim: {description: claim land where you stand, default: false} factions.claim: {description: claim land where you stand, default: false}
factions.claim.radius: {description: claim land with radius, default: false} factions.claim.radius: {description: claim land with radius, default: false}
@ -21,6 +21,7 @@ permissions:
factions.demote: {description: demote lesser members in your faction, default: false} factions.demote: {description: demote lesser members in your faction, default: false}
factions.description: {description: change faction description, default: false} factions.description: {description: change faction description, default: false}
factions.disband: {description: disband faction, default: false} factions.disband: {description: disband faction, default: false}
factions.faction: {description: show faction information, default: false}
factions.flag: {description: read faction flags, default: false} factions.flag: {description: read faction flags, default: false}
factions.flag.set: {description: set faction flags, default: false} factions.flag.set: {description: set faction flags, default: false}
factions.home: {description: teleport to faction home, default: false} factions.home: {description: teleport to faction home, default: false}
@ -45,14 +46,12 @@ permissions:
factions.officer.any: {description: set officers for another faction, default: false} factions.officer.any: {description: set officers for another faction, default: false}
factions.open: {description: set if invitation is required to join, default: false} factions.open: {description: set if invitation is required to join, default: false}
factions.perm: {description: change faction permissions, default: false} factions.perm: {description: change faction permissions, default: false}
factions.power: {description: show player power} factions.player: {description: show player information}
factions.power.any: {description: show another players power}
factions.powerboost: {description: set powerboost, default: false} factions.powerboost: {description: set powerboost, default: false}
factions.promote: {description: promote lesser members in your faction, default: false} factions.promote: {description: promote lesser members in your faction, default: false}
factions.relation: {description: set relation wish to another faction, default: false} factions.relation: {description: set relation wish to another faction, default: false}
factions.seechunk: {description: see the chunk you stand in, default: false} factions.seechunk: {description: see the chunk you stand in, default: false}
factions.sethome: {description: set the faction home, default: false} factions.sethome: {description: set the faction home, default: false}
factions.show: {description: show faction information, default: false}
factions.name: {description: set faction name, default: false} factions.name: {description: set faction name, default: false}
factions.title: {description: set player title, default: false} factions.title: {description: set player title, default: false}
factions.title.color: {description: set player title with color, default: false} factions.title.color: {description: set player title with color, default: false}
@ -67,7 +66,7 @@ permissions:
factions.access: true factions.access: true
factions.access.any: true factions.access.any: true
factions.access.view: true factions.access.view: true
factions.adminmode: true factions.admin: true
factions.autoclaim: true factions.autoclaim: true
factions.claim: true factions.claim: true
factions.claim.radius: true factions.claim.radius: true
@ -75,6 +74,7 @@ permissions:
factions.demote: true factions.demote: true
factions.description: true factions.description: true
factions.disband: true factions.disband: true
factions.faction: true
factions.flag: true factions.flag: true
factions.flag.set: true factions.flag.set: true
factions.home: true factions.home: true
@ -93,14 +93,12 @@ permissions:
factions.officer.any: true factions.officer.any: true
factions.open: true factions.open: true
factions.perm: true factions.perm: true
factions.power: true factions.player: true
factions.power.any: true
factions.powerboost: true factions.powerboost: true
factions.promote: true factions.promote: true
factions.relation: true factions.relation: true
factions.seechunk: true factions.seechunk: true
factions.sethome: true factions.sethome: true
factions.show: true
factions.name: true factions.name: true
factions.title: true factions.title: true
factions.title.color: true factions.title.color: true
@ -142,7 +140,7 @@ permissions:
default: false default: false
children: children:
factions.kit.rank0: true factions.kit.rank0: true
factions.adminmode: true factions.admin: true
factions.kit.rank0: factions.kit.rank0:
default: false default: false
children: children:
@ -155,6 +153,7 @@ permissions:
factions.demote: true factions.demote: true
factions.description: true factions.description: true
factions.disband: true factions.disband: true
factions.faction: true
factions.flag: true factions.flag: true
factions.home: true factions.home: true
factions.invite: true factions.invite: true
@ -168,13 +167,11 @@ permissions:
factions.officer: true factions.officer: true
factions.open: true factions.open: true
factions.perm: true factions.perm: true
factions.power: true factions.player: true
factions.power.any: true
factions.promote: true factions.promote: true
factions.relation: true factions.relation: true
factions.seechunk: true factions.seechunk: true
factions.sethome: true factions.sethome: true
factions.show: true
factions.name: true factions.name: true
factions.title: true factions.title: true
factions.title.color: true factions.title.color: true

View File

@ -13,7 +13,7 @@ public enum Perm
ACCESS("access"), ACCESS("access"),
ACCESS_ANY("access.any"), ACCESS_ANY("access.any"),
ACCESS_VIEW("access.view"), ACCESS_VIEW("access.view"),
ADMIN("adminmode"), ADMIN("admin"),
AUTOCLAIM("autoclaim"), AUTOCLAIM("autoclaim"),
CLAIM("claim"), CLAIM("claim"),
CLAIM_RADIUS("claim.radius"), CLAIM_RADIUS("claim.radius"),
@ -21,6 +21,7 @@ public enum Perm
DEMOTE("demote"), DEMOTE("demote"),
DESCRIPTION("description"), DESCRIPTION("description"),
DISBAND("disband"), DISBAND("disband"),
FACTION("faction"),
FLAG("flag"), FLAG("flag"),
FLAG_SET("flag.set"), FLAG_SET("flag.set"),
HOME("home"), HOME("home"),
@ -45,15 +46,12 @@ public enum Perm
OFFICER_ANY("officer.any"), OFFICER_ANY("officer.any"),
OPEN("open"), OPEN("open"),
PERM("perm"), PERM("perm"),
POWER("power"), PLAYER("player"),
POWER_ANY("power.any"),
POWERBOOST("powerboost"), POWERBOOST("powerboost"),
PROMOTE("promote"), PROMOTE("promote"),
RELATION("relation"), RELATION("relation"),
SAVE("save"),
SEE_CHUNK("seechunk"), SEE_CHUNK("seechunk"),
SETHOME("sethome"), SETHOME("sethome"),
SHOW("show"),
NAME("name"), NAME("name"),
TITLE("title"), TITLE("title"),
TITLE_COLOR("title.color"), TITLE_COLOR("title.color"),

View File

@ -19,6 +19,7 @@ public class CmdFactions extends FCommand
public CmdFactionsDemote cmdFactionsDemote = new CmdFactionsDemote(); public CmdFactionsDemote cmdFactionsDemote = new CmdFactionsDemote();
public CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription(); public CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription();
public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband(); public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband();
public CmdFactionsFaction cmdFactionsFaction = new CmdFactionsFaction();
public CmdFactionsFlag cmdFactionsFlag = new CmdFactionsFlag(); public CmdFactionsFlag cmdFactionsFlag = new CmdFactionsFlag();
public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome(); public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome();
public CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite(); public CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite();
@ -31,7 +32,7 @@ public class CmdFactions extends FCommand
public CmdFactionsMoney cmdFactionsMoney = new CmdFactionsMoney(); public CmdFactionsMoney cmdFactionsMoney = new CmdFactionsMoney();
public CmdFactionsOpen cmdFactionsOpen = new CmdFactionsOpen(); public CmdFactionsOpen cmdFactionsOpen = new CmdFactionsOpen();
public CmdFactionsPerm cmdFactionsPerm = new CmdFactionsPerm(); public CmdFactionsPerm cmdFactionsPerm = new CmdFactionsPerm();
public CmdFactionsPower cmdFactionsPower = new CmdFactionsPower(); public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer();
public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost(); public CmdFactionsPowerBoost cmdFactionsPowerBoost = new CmdFactionsPowerBoost();
public CmdFactionsPromote cmdFactionsPromote = new CmdFactionsPromote(); public CmdFactionsPromote cmdFactionsPromote = new CmdFactionsPromote();
public CmdFactionsRelationAlly cmdFactionsRelationAlly = new CmdFactionsRelationAlly(); public CmdFactionsRelationAlly cmdFactionsRelationAlly = new CmdFactionsRelationAlly();
@ -40,7 +41,6 @@ public class CmdFactions extends FCommand
public CmdFactionsRelationTruce cmdFactionsRelationTruce = new CmdFactionsRelationTruce(); public CmdFactionsRelationTruce cmdFactionsRelationTruce = new CmdFactionsRelationTruce();
public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk(); public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk();
public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome(); public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome();
public CmdFactionsShow cmdFactionsShow = new CmdFactionsShow();
public CmdFactionsName cmdFactionsName = new CmdFactionsName(); public CmdFactionsName cmdFactionsName = new CmdFactionsName();
public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle(); public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle();
public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim(); public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim();
@ -61,8 +61,8 @@ public class CmdFactions extends FCommand
this.addSubCommand(HelpCommand.get()); this.addSubCommand(HelpCommand.get());
this.addSubCommand(this.cmdFactionsList); this.addSubCommand(this.cmdFactionsList);
this.addSubCommand(this.cmdFactionsShow); this.addSubCommand(this.cmdFactionsFaction);
this.addSubCommand(this.cmdFactionsPower); this.addSubCommand(this.cmdFactionsPlayer);
this.addSubCommand(this.cmdFactionsJoin); this.addSubCommand(this.cmdFactionsJoin);
this.addSubCommand(this.cmdFactionsLeave); this.addSubCommand(this.cmdFactionsLeave);
this.addSubCommand(this.cmdFactionsHome); this.addSubCommand(this.cmdFactionsHome);

View File

@ -24,16 +24,16 @@ import com.massivecraft.mcore.util.TimeDiffUtil;
import com.massivecraft.mcore.util.TimeUnit; import com.massivecraft.mcore.util.TimeUnit;
import com.massivecraft.mcore.util.Txt; 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.addOptionalArg("faction", "you");
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.SHOW.node)); this.addRequirements(ReqHasPerm.get(Perm.FACTION.node));
} }
@Override @Override

View File

@ -62,6 +62,12 @@ public class CmdFactionsPerm extends FCommand
Rel rel = this.arg(2, ARRel.get()); Rel rel = this.arg(2, ARRel.get());
if (rel == null) return; 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); Boolean val = this.arg(3, ARBoolean.get(), null);
if (val == null) return; if (val == null) return;

View File

@ -6,16 +6,16 @@ import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; 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.addOptionalArg("player", "you");
this.addRequirements(ReqFactionsEnabled.get()); this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.POWER.node)); this.addRequirements(ReqHasPerm.get(Perm.PLAYER.node));
} }
@Override @Override
@ -25,8 +25,7 @@ public class CmdFactionsPower extends FCommand
UPlayer target = this.arg(0, ARUPlayer.getStartAny(sender), usender); UPlayer target = this.arg(0, ARUPlayer.getStartAny(sender), usender);
if (target == null) return; if (target == null) return;
// Perm // TODO: Print info
if (target != usender && ! Perm.POWER_ANY.has(sender, true)) return;
double powerBoost = target.getPowerBoost(); double powerBoost = target.getPowerBoost();
String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? " (bonus: " : " (penalty: ") + powerBoost + ")"; String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? " (bonus: " : " (penalty: ") + powerBoost + ")";

View File

@ -643,6 +643,7 @@ public class Faction extends Entity<Faction> implements EconomyParticipator
{ {
Entry<FPerm, Set<Rel>> entry = iter.next(); Entry<FPerm, Set<Rel>> entry = iter.next();
FPerm key = entry.getKey(); FPerm key = entry.getKey();
if (key == null) System.out.println("key was null");
Set<Rel> keyDefault = key.getDefault(this); Set<Rel> keyDefault = key.getDefault(this);
Set<Rel> value = entry.getValue(); Set<Rel> value = entry.getValue();