This commit is contained in:
Olof Larsson
2011-10-24 13:02:48 +02:00
parent 5f437b1862
commit 8eec55e37e
5 changed files with 28 additions and 24 deletions

View File

@ -25,7 +25,7 @@ public enum FFlag
MONSTERS("monsters", "<i>Can monsters spawn in this territory?", true, false),
EXPLOSIONS("explosions", "<i>Can explosions occur in this territory?", true, false),
FIRESPREAD("firespread", "<i>Can fire spread in territory?", true, false),
LIGHTNING("lightning", "<i>Can lightning strike in this territory?", true, false),
//LIGHTNING("lightning", "<i>Can lightning strike in this territory?", true, false), Possible to add later.
ENDERGRIEF("endergrief", "<i>Can endermen grief in this territory?", false, true),
;
@ -86,13 +86,13 @@ public enum FFlag
if (str.startsWith("m")) return MONSTERS;
if (str.startsWith("e")) return EXPLOSIONS;
if (str.startsWith("fi")) return FIRESPREAD;
if (str.startsWith("l")) return LIGHTNING;
//if (str.startsWith("l")) return LIGHTNING;
return null;
}
public String getStateInfo(boolean value, boolean withDesc)
{
String ret = (value ? "<g>YES" : "<b>NOO") + "<h> " + this.getNicename();
String ret = (value ? "<g>YES" : "<b>NOO") + "<c> " + this.getNicename();
if (withDesc)
{
ret += " " + this.getDescription();

View File

@ -14,7 +14,6 @@ import com.massivecraft.factions.FLocation;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.iface.RelationParticipator;
import com.massivecraft.factions.util.RelationUtil;
/**
* Permissions that you (a player) may or may not have in the territory of a certain faction.
@ -103,7 +102,7 @@ public enum FPerm
ret += " ";
}
ret +="<h>"+this.getNicename();
ret +="<c>"+this.getNicename();
if (withDesc)
{
ret += " <i>" + this.getDescription();
@ -149,8 +148,15 @@ public enum FPerm
private static final String errorpattern = "<b>%s<b> can't %s in the territory of %s<b>.";
public boolean has(RelationParticipator testSubject, Faction hostFaction, boolean informIfNot)
{
Faction factionDoer = RelationUtil.getFaction(testSubject);
boolean ret = hostFaction.getPermittedRelations(this).contains(hostFaction.getRelationTo(factionDoer));
//Faction factionDoer = RelationUtil.getFaction(testSubject);
//P.p.log("Testing the permission "+this.toString()+" for a "+testSubject.getClass().getSimpleName());
//P.p.log("hostFaction: "+hostFaction);
Rel rel = testSubject.getRelationTo(hostFaction);
//P.p.log("rel: "+rel);
boolean ret = hostFaction.getPermittedRelations(this).contains(rel);
if (!ret && informIfNot && testSubject instanceof FPlayer)
{
FPlayer fplayer = (FPlayer)testSubject;

View File

@ -16,7 +16,7 @@ public enum Permission
DEINVITE("deinvite"),
DESCRIPTION("description"),
DISBAND("disband"),
DISBAND_ANY("disband.any"),
DISBAND_ANY("disband.any"), // WHAT TO DO?
FLAG("flag"),
FLAG_ANY("flag.any"),
PERM("perm"),
@ -36,7 +36,7 @@ public enum Permission
MONEY_BALANCE_ANY("money.balance.any"),
MONEY_DEPOSIT("money.deposit"),
MONEY_WITHDRAW("money.withdraw"),
MONEY_WITHDRAW_ANY("money.withdraw.any"),
MONEY_WITHDRAW_ANY("money.withdraw.any"), // WHAT TO DO?
MONEY_F2F("money.f2f"),
MONEY_F2P("money.f2p"),
MONEY_P2F("money.p2f"),
@ -48,7 +48,7 @@ public enum Permission
RELOAD("reload"),
SAVE("save"),
SETHOME("sethome"),
SETHOME_ANY("sethome.any"),
SETHOME_ANY("sethome.any"), // WHAT TO DO?
SHOW("show"),
TAG("tag"),
TITLE("title"),