#1044 Fix custom join message feature; change default to empty string

This commit is contained in:
ljacqu
2017-01-07 11:34:58 +01:00
parent deb5c65f89
commit 47e6cc4885
3 changed files with 9 additions and 9 deletions
@@ -173,7 +173,7 @@ public class PlayerListener implements Listener {
}
String customJoinMessage = settings.getProperty(RegistrationSettings.CUSTOM_JOIN_MESSAGE);
if (customJoinMessage.isEmpty() && ! customJoinMessage.equalsIgnoreCase("none")) {
if (!customJoinMessage.isEmpty()) {
event.setJoinMessage(customJoinMessage.replace("{PLAYERNAME}", player.getName())
.replace("{DISPLAYNAME]", player.getDisplayName()));
}
@@ -76,12 +76,12 @@ public class RegistrationSettings implements SettingsHolder {
@Comment({
"The custom join message that will be sent after a successful login,",
"use 'none' to use the original one.",
"Available variables:,",
"keep empty to use the original one.",
"Available variables:",
"{PLAYERNAME}: the player name (no colors)",
"{DISPLAYNAME}: the player name (with colors)"})
public static final Property<String> CUSTOM_JOIN_MESSAGE =
newProperty("settings.customJoinMessage", "none");
newProperty("settings.customJoinMessage", "");
@Comment("Should we remove the leave messages of unlogged users?")
public static final Property<Boolean> REMOVE_UNLOGGED_LEAVE_MESSAGE =