summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-08-08 22:40:54 +0200
committersnowleo <schneeleo@gmail.com>2011-08-08 22:40:54 +0200
commit327c15c5be18c10f4d184ef97f361ddf4b197582 (patch)
treed6778ca8b1d8d759dbd7586b2f66f71cbf7117c6
parent858e2a8b8986394029dd4f7997c667df00ebdcbe (diff)
downloadEssentials-327c15c5be18c10f4d184ef97f361ddf4b197582.tar
Essentials-327c15c5be18c10f4d184ef97f361ddf4b197582.tar.gz
Essentials-327c15c5be18c10f4d184ef97f361ddf4b197582.tar.lz
Essentials-327c15c5be18c10f4d184ef97f361ddf4b197582.tar.xz
Essentials-327c15c5be18c10f4d184ef97f361ddf4b197582.zip
Allow other plugins to use the same first line on signs as essentials. Just make sure that the player, who creates the sign does not have essentials.signs.signname.create or essentials.signs.create.signname permission.
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
index 3dfc1b86b..fc5dd8553 100644
--- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
+++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
@@ -33,13 +33,15 @@ public class EssentialsSign
public final boolean onSignCreate(final SignChangeEvent event, final IEssentials ess)
{
final ISign sign = new EventSign(event);
- sign.setLine(0, String.format(FORMAT_FAIL, this.signName));
final User user = ess.getUser(event.getPlayer());
if (!(user.isAuthorized("essentials.signs." + signName.toLowerCase() + ".create")
|| user.isAuthorized("essentials.signs.create." + signName.toLowerCase())))
{
- return false;
+ // Return true, so other plugins can use the same sign title, just hope
+ // they won't change it to ยง1[Signname]
+ return true;
}
+ sign.setLine(0, String.format(FORMAT_FAIL, this.signName));
try
{
final boolean ret = onSignCreate(sign, user, getUsername(user), ess);
@@ -57,7 +59,8 @@ public class EssentialsSign
{
ess.showError(user, ex, signName);
}
- return false;
+ // Return true, so the player sees the wrong sign.
+ return true;
}
public String getSuccessName()