diff --git a/docs/config.md b/docs/config.md index 65a23f803..8ade72172 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1,5 +1,5 @@ - + ## AuthMe Configuration The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder, @@ -292,7 +292,8 @@ settings: # keep empty to use the original one. # Available variables: # {PLAYERNAME}: the player name (no colors) - # {DISPLAYNAME}: the player name (with colors) + # {DISPLAYNAME}: the player display name (with colors) + # {DISPLAYNAMENOCOLOR}: the player display name (without colors) customJoinMessage: '' # Should we remove the leave messages of unlogged users? removeUnloggedLeaveMessage: false @@ -442,7 +443,7 @@ Security: # How many minutes before resetting the count for failed logins by IP and username # Default: 480 minutes (8 hours) minutesBeforeCounterReset: 480 - # If not empty this command will be executed instead of using the internal server ban system. + # The command to execute instead of using the internal ban system, empty if disabled. # Available placeholders: %player%, %ip% customCommand: '' recoveryCode: @@ -543,4 +544,4 @@ To change settings on a running server, save your changes to config.yml and use --- -This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sat Sep 30 19:52:39 CEST 2017 +This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Mon Oct 09 09:22:33 CEST 2017 diff --git a/src/main/java/fr/xephi/authme/listener/PlayerListener.java b/src/main/java/fr/xephi/authme/listener/PlayerListener.java index bc776333c..80946a5e5 100644 --- a/src/main/java/fr/xephi/authme/listener/PlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/PlayerListener.java @@ -15,6 +15,7 @@ import fr.xephi.authme.settings.SpawnLoader; import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; +import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; @@ -172,7 +173,8 @@ public class PlayerListener implements Listener { event.setJoinMessage(customJoinMessage .replace("{PLAYERNAME}", player.getName()) .replace("{DISPLAYNAME}", player.getDisplayName()) - .replace("{PLAYERLISTNAME}", player.getPlayerListName())); + .replace("{DISPLAYNAMENOCOLOR}", ChatColor.stripColor(player.getDisplayName())) + ); } if (!settings.getProperty(RegistrationSettings.DELAY_JOIN_MESSAGE)) { diff --git a/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java b/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java index 9dbdccb98..42e0c9f01 100644 --- a/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java +++ b/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java @@ -13,6 +13,7 @@ import fr.xephi.authme.util.lazytags.Tag; import fr.xephi.authme.util.lazytags.TagReplacer; import org.bukkit.ChatColor; import org.bukkit.Server; +import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import javax.annotation.PostConstruct; @@ -55,16 +56,18 @@ public class WelcomeMessageConfiguration implements Reloadable { /** List of all supported tags for the welcome message. */ private final List> availableTags = Arrays.asList( - createTag("&", () -> String.valueOf(ChatColor.COLOR_CHAR)), - createTag("{PLAYER}", pl -> pl.getName()), - createTag("{ONLINE}", () -> Integer.toString(bukkitService.getOnlinePlayers().size())), - createTag("{MAXPLAYERS}", () -> Integer.toString(server.getMaxPlayers())), - createTag("{IP}", pl -> PlayerUtils.getPlayerIp(pl)), - createTag("{LOGINS}", () -> Integer.toString(playerCache.getLogged())), - createTag("{WORLD}", pl -> pl.getWorld().getName()), - createTag("{SERVER}", () -> server.getServerName()), - createTag("{VERSION}", () -> server.getBukkitVersion()), - createTag("{COUNTRY}", pl -> geoIpService.getCountryName(PlayerUtils.getPlayerIp(pl)))); + createTag("&", () -> String.valueOf(ChatColor.COLOR_CHAR)), + createTag("{PLAYER}", HumanEntity::getName), + createTag("{DISPLAYNAME}", Player::getDisplayName), + createTag("{DISPLAYNAMENOCOLOR}", Player::getDisplayName), + createTag("{ONLINE}", () -> Integer.toString(bukkitService.getOnlinePlayers().size())), + createTag("{MAXPLAYERS}", () -> Integer.toString(server.getMaxPlayers())), + createTag("{IP}", PlayerUtils::getPlayerIp), + createTag("{LOGINS}", () -> Integer.toString(playerCache.getLogged())), + createTag("{WORLD}", pl -> pl.getWorld().getName()), + createTag("{SERVER}", () -> server.getServerName()), + createTag("{VERSION}", () -> server.getBukkitVersion()), + createTag("{COUNTRY}", pl -> geoIpService.getCountryName(PlayerUtils.getPlayerIp(pl)))); private TagReplacer messageSupplier; diff --git a/src/main/java/fr/xephi/authme/settings/properties/RegistrationSettings.java b/src/main/java/fr/xephi/authme/settings/properties/RegistrationSettings.java index a9fb7fc50..324f0f1f9 100644 --- a/src/main/java/fr/xephi/authme/settings/properties/RegistrationSettings.java +++ b/src/main/java/fr/xephi/authme/settings/properties/RegistrationSettings.java @@ -81,7 +81,7 @@ public final class RegistrationSettings implements SettingsHolder { "Available variables:", "{PLAYERNAME}: the player name (no colors)", "{DISPLAYNAME}: the player display name (with colors)", - "{PLAYERLISTNAME}: the player list name (with colors)"}) + "{DISPLAYNAMENOCOLOR}: the player display name (without colors)"}) public static final Property CUSTOM_JOIN_MESSAGE = newProperty("settings.customJoinMessage", "");