summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-11-04 00:45:03 +0000
committerKHobbits <rob@khobbits.co.uk>2011-11-04 00:45:03 +0000
commit4ecb31bc93fa3102a9532b1e4a8f117d2fa95219 (patch)
treeef2932cdbd5e576e52c69a32740ffa401277c035
parent3c41319d72d22201e1d85be34a2679fe26f72102 (diff)
parent0e9eddd2f96692d68a7f98a94e02e8499241ed05 (diff)
downloadEssentials-4ecb31bc93fa3102a9532b1e4a8f117d2fa95219.tar
Essentials-4ecb31bc93fa3102a9532b1e4a8f117d2fa95219.tar.gz
Essentials-4ecb31bc93fa3102a9532b1e4a8f117d2fa95219.tar.lz
Essentials-4ecb31bc93fa3102a9532b1e4a8f117d2fa95219.tar.xz
Essentials-4ecb31bc93fa3102a9532b1e4a8f117d2fa95219.zip
Merge branch 'master' of github.com:essentials/Essentials into essmaster
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignProtection.java30
1 files changed, 20 insertions, 10 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
index 157535cd9..ced8443a6 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
@@ -35,10 +35,15 @@ public class SignProtection extends EssentialsSign
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
{
sign.setLine(3, "§4" + username);
- if (hasAdjacentBlock(sign.getBlock()) && isBlockProtected(sign.getBlock(), player, username, true) != SignProtectionState.NOT_ALLOWED)
+ if (hasAdjacentBlock(sign.getBlock()))
{
- sign.setLine(3, "§1" + username);
- return true;
+ final SignProtectionState state = isBlockProtected(sign.getBlock(), player, username, true);
+ if (state == SignProtectionState.NOSIGN || state == SignProtectionState.OWNER
+ || player.isAuthorized("essentials.signs.protection.override"))
+ {
+ sign.setLine(3, "§1" + username);
+ return true;
+ }
}
player.sendMessage(Util.i18n("signProtectInvalidLocation"));
return false;
@@ -183,11 +188,6 @@ public class SignProtection extends EssentialsSign
SignProtectionState retstate = SignProtectionState.NOSIGN;
for (SignProtectionState state : signs.values())
{
-
- if (state == SignProtectionState.OWNER)
- {
- return state;
- }
if (state == SignProtectionState.ALLOWED)
{
retstate = state;
@@ -197,6 +197,16 @@ public class SignProtection extends EssentialsSign
retstate = state;
}
}
+ if (!secure || retstate == SignProtectionState.NOSIGN)
+ {
+ for (SignProtectionState state : signs.values())
+ {
+ if (state == SignProtectionState.OWNER)
+ {
+ return state;
+ }
+ }
+ }
return retstate;
}
@@ -300,7 +310,7 @@ public class SignProtection extends EssentialsSign
player.sendMessage(Util.format("noDestroyPermission", block.getType().toString().toLowerCase()));
return false;
}
-
+
@Override
public boolean onBlockBreak(final Block block, final IEssentials ess)
{
@@ -324,7 +334,7 @@ public class SignProtection extends EssentialsSign
return state == SignProtectionState.NOSIGN;
}
-
+
@Override
public boolean onBlockIgnite(final Block block, final IEssentials ess)
{