[trunk] Groups for Protection signs.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1206 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-04-16 05:36:32 +00:00
parent a9a178466c
commit 76dda664d7

View File

@ -238,14 +238,17 @@ public class EssentialsBlockListener extends BlockListener
Sign sign = new CraftSign(block);
if (sign.getLine(0).equalsIgnoreCase("§1[Protection]") && !user.isAuthorized("essentials.signs.protection.override"))
{
if (sign.getLine(1).equalsIgnoreCase(user.getName()))
{
for (int i = 1; i <= 2; i++) {
String line = sign.getLine(i);
if (line.startsWith("(") && line.endsWith(")")) {
line = line.substring(1, line.length() - 2);
if (user.getGroup().equalsIgnoreCase(line)) {
return ALLOWED;
}
if (sign.getLine(2).equalsIgnoreCase(user.getName()))
{
} else if (line.equalsIgnoreCase(user.getName())) {
return ALLOWED;
}
}
if (sign.getLine(3).equalsIgnoreCase(user.getName()))
{
return ALLOWED;