summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-23 01:43:02 +0200
committersnowleo <schneeleo@gmail.com>2011-07-23 01:43:02 +0200
commit3cedfeef2c0afe0b7b428a7e26a560e04529aae3 (patch)
treebee31e5e9987c883870d2b53e193c2066ff03b6c
parenta20f2b71da49ac1c65fd577be2264ae14a85367c (diff)
downloadEssentials-3cedfeef2c0afe0b7b428a7e26a560e04529aae3.tar
Essentials-3cedfeef2c0afe0b7b428a7e26a560e04529aae3.tar.gz
Essentials-3cedfeef2c0afe0b7b428a7e26a560e04529aae3.tar.lz
Essentials-3cedfeef2c0afe0b7b428a7e26a560e04529aae3.tar.xz
Essentials-3cedfeef2c0afe0b7b428a7e26a560e04529aae3.zip
Separate config setting for prefix/suffix
-rw-r--r--Essentials/src/com/earth2me/essentials/ISettings.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/Settings.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java17
-rw-r--r--Essentials/src/config.yml5
4 files changed, 22 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java
index c53992461..13717f469 100644
--- a/Essentials/src/com/earth2me/essentials/ISettings.java
+++ b/Essentials/src/com/earth2me/essentials/ISettings.java
@@ -130,4 +130,6 @@ public interface ISettings extends IConf
boolean isPlayerCommand(String string);
public boolean useBukkitPermissions();
+
+ public boolean addPrefixSuffix();
}
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java
index 9f4bde9e0..63e017bf5 100644
--- a/Essentials/src/com/earth2me/essentials/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/Settings.java
@@ -468,4 +468,9 @@ public class Settings implements ISettings
{
return config.getBoolean("use-bukkit-permissions", false);
}
+
+ public boolean addPrefixSuffix()
+ {
+ return config.getBoolean("add-prefix-suffix", false);
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index b1392a2e6..a0b072752 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -246,14 +246,17 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
}
- final String prefix = ess.getPermissionsHandler().getPrefix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
- final String suffix = ess.getPermissionsHandler().getSuffix(this).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().addPrefixSuffix())
{
- nickname.append("§f");
+ final String prefix = ess.getPermissionsHandler().getPrefix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
+ final String suffix = ess.getPermissionsHandler().getSuffix(this).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("§"))
+ {
+ nickname.append("§f");
+ }
}
return nickname.toString();
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml
index ea40bd87d..186d4a1f0 100644
--- a/Essentials/src/config.yml
+++ b/Essentials/src/config.yml
@@ -37,6 +37,11 @@ nickname-prefix: '~'
# Disable this if you have any other plugin, that modifies the displayname of a user.
change-displayname: true
+# Adds the prefix and suffix to the displayname of the player, so it will be displayed in messages and lists.
+# The prefix/suffix can be set using Permissions, Group Manager or PermissionsEx.
+# The value of change-displayname (above) has to be true.
+add-prefix-suffix: false
+
# The delay, in seconds, required between /home, /tp, etc.
teleport-cooldown: 0