From 327c15c5be18c10f4d184ef97f361ddf4b197582 Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 8 Aug 2011 22:40:54 +0200 Subject: [PATCH] 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. --- .../com/earth2me/essentials/signs/EssentialsSign.java | 9 ++++++--- 1 file 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()