mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-22 03:11:55 +00:00
Separate config setting for prefix/suffix
This commit is contained in:
parent
a20f2b71da
commit
3cedfeef2c
|
@ -130,4 +130,6 @@ public interface ISettings extends IConf
|
|||
boolean isPlayerCommand(String string);
|
||||
|
||||
public boolean useBukkitPermissions();
|
||||
|
||||
public boolean addPrefixSuffix();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue