mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-24 03:05:52 +01:00
Working permdelta parser
This commit is contained in:
parent
371261a07f
commit
958a1e0d9f
@ -165,6 +165,7 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
//this.peacefulExplosionsEnabled = false;
|
||||
this.money = 0.0;
|
||||
this.flagOverrides = new LinkedHashMap<FactionFlag, Boolean>();
|
||||
this.permOverrides = new LinkedHashMap<FactionPerm, Set<Rel>>();
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class CmdDescription extends FCommand
|
||||
// Broadcast the description to everyone
|
||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
||||
{
|
||||
fplayer.msg("<i>The faction %s<i> changed their description to:", myFaction.describeTo(fplayer));
|
||||
fplayer.msg("<h>%s<i> changed their description to:", myFaction.describeTo(fplayer));
|
||||
fplayer.msg("<h>"+myFaction.getDescription());
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class CmdPerm extends FCommand
|
||||
}
|
||||
|
||||
// TODO: Awesomesause parser for deltas...
|
||||
Set<Rel> targetValue = FactionPerm.parseRelDeltas(TextUtil.implode(args.subList(2, args.size()-1), " "), faction.getPerm(perm));
|
||||
Set<Rel> targetValue = FactionPerm.parseRelDeltas(TextUtil.implode(args.subList(2, args.size()), " "), faction.getPerm(perm));
|
||||
|
||||
// Do the sender have the right to change perms for this faction?
|
||||
if (Permission.PERM_ANY.has(sender))
|
||||
|
@ -91,7 +91,7 @@ public enum FactionFlag
|
||||
|
||||
public String getStateInfo(boolean value, boolean withDesc)
|
||||
{
|
||||
String ret = (value ? "<g>YES" : "<b>NOT") + "<h> " + this.getNicename();
|
||||
String ret = (value ? "<g>YES" : "<b>NOO") + "<h> " + this.getNicename();
|
||||
if (withDesc)
|
||||
{
|
||||
ret += " " + this.getDescription();
|
||||
|
@ -71,13 +71,13 @@ public enum FactionPerm
|
||||
List<String> rels = new ArrayList<String>();
|
||||
for (Rel rel : value)
|
||||
{
|
||||
rels.add("<i>"+rel.nicename);
|
||||
rels.add("<p>"+rel.nicename);
|
||||
}
|
||||
ret += TextUtil.implode(rels, "<n> ,");
|
||||
ret += TextUtil.implode(rels, "<c> + ");
|
||||
|
||||
if (withDesc)
|
||||
{
|
||||
ret += " " + this.getDescription();
|
||||
ret += " <i>" + this.getDescription();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user