#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

View File

@ -1,5 +1,5 @@
<!-- AUTO-GENERATED FILE! Do not edit this directly -->
<!-- File auto-generated on Sat Jan 07 11:07:10 CET 2017. See docs/config/config.tpl.md -->
<!-- File auto-generated on Sat Jan 07 11:33:48 CET 2017. See docs/config/config.tpl.md -->
## AuthMe Configuration
The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder,
@ -299,11 +299,11 @@ settings:
# Should we delay the join message and display it once the player has logged in?
delayJoinMessage: false
# 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)
customJoinMessage: 'none'
customJoinMessage: ''
# Should we remove the leave messages of unlogged users?
removeUnloggedLeaveMessage: false
# Should we remove join messages altogether?
@ -460,4 +460,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 Jan 07 11:07:10 CET 2017
This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sat Jan 07 11:33:48 CET 2017

View File

@ -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()));
}

View File

@ -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 =