Simplified the perm command.

This commit is contained in:
Olof Larsson
2012-05-09 06:29:52 +02:00
parent a0a163056d
commit 5988e8e5af
6 changed files with 61 additions and 48 deletions

View File

@@ -1,9 +1,7 @@
package com.massivecraft.factions.struct;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bukkit.Location;
@@ -128,41 +126,6 @@ public enum FPerm
return ret;
}
public static Set<Rel> parseRelDeltas(String str, Set<Rel> current)
{
Set<Rel> ret = new HashSet<Rel>();
ret.addAll(current);
List<String> nodes = new ArrayList<String>(Arrays.asList(str.split("\\s+")));
for (String node : nodes)
{
boolean add = true;
if (node.startsWith("-"))
{
add = false;
node = node.substring(1);
}
else if (node.startsWith("+"))
{
node = node.substring(1);
}
Rel rel = Rel.parse(node);
if (rel == null) continue;
if (add)
{
ret.add(rel);
}
else
{
ret.remove(rel);
}
}
return ret;
}
private static final String errorpattern = "%s<b> does not allow you to %s<b>.";
public boolean has(Object testSubject, Faction hostFaction, boolean informIfNot)
{