summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-10-27 06:17:18 +0100
committerKHobbits <rob@khobbits.co.uk>2011-10-27 06:17:18 +0100
commit04de66bc8aaa018b47a3193e37f8e34d1105f615 (patch)
tree4eb687c080e6a6722361526b195770c23ac5f785
parent32cc1b66a4b9293a1fbbab63d761dc96f99d7619 (diff)
downloadEssentials-04de66bc8aaa018b47a3193e37f8e34d1105f615.tar
Essentials-04de66bc8aaa018b47a3193e37f8e34d1105f615.tar.gz
Essentials-04de66bc8aaa018b47a3193e37f8e34d1105f615.tar.lz
Essentials-04de66bc8aaa018b47a3193e37f8e34d1105f615.tar.xz
Essentials-04de66bc8aaa018b47a3193e37f8e34d1105f615.zip
Sneaking in an option to disable prefix/suffix selectively.
(This will probably be removed during ess chat rewrite).
-rw-r--r--Essentials/src/com/earth2me/essentials/ISettings.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/Settings.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java20
3 files changed, 29 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java
index d058d892a..fa36ecc9f 100644
--- a/Essentials/src/com/earth2me/essentials/ISettings.java
+++ b/Essentials/src/com/earth2me/essentials/ISettings.java
@@ -124,6 +124,10 @@ public interface ISettings extends IConf
boolean useBukkitPermissions();
boolean addPrefixSuffix();
+
+ boolean disablePrefix();
+
+ boolean disableSuffix();
boolean isUpdateEnabled();
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java
index e59c3c2b2..954e52542 100644
--- a/Essentials/src/com/earth2me/essentials/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/Settings.java
@@ -498,6 +498,16 @@ public class Settings implements ISettings
{
return config.getBoolean("add-prefix-suffix", ess.getServer().getPluginManager().isPluginEnabled("EssentialsChat"));
}
+
+ public boolean disablePrefix()
+ {
+ return config.getBoolean("disablePrefix", false);
+ }
+
+ public boolean disableSuffix()
+ {
+ return config.getBoolean("disableSuffix", false);
+ }
@Override
public boolean isUpdateEnabled()
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index bcc871eab..ef3e91a55 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -269,12 +269,22 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
if (ess.getSettings().addPrefixSuffix())
{
- final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
- final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
- nickname.insert(0, prefix);
- nickname.append(suffix);
- if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§"))
+ if (!ess.getSettings().disablePrefix())
+ {
+ final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
+ nickname.insert(0, prefix);
+ }
+ if (!ess.getSettings().disableSuffix())
+ {
+ final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
+ nickname.append(suffix);
+ if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§"))
+ {
+ nickname.append("§f");
+ }
+ }
+ else
{
nickname.append("§f");
}