mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-18 14:47:47 +01:00
Do not create a welcome.txt file when boolean is false (#1633)
* Update WelcomeMessageConfiguration.java * Update WelcomeMessageConfiguration.java * Fix compile error
This commit is contained in:
parent
d1d51f5aca
commit
1d6729425f
@ -74,6 +74,10 @@ public class WelcomeMessageConfiguration implements Reloadable {
|
||||
@PostConstruct
|
||||
@Override
|
||||
public void reload() {
|
||||
if (!(service.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE))) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> welcomeMessage = new ArrayList<>();
|
||||
for (String line : readWelcomeFile()) {
|
||||
welcomeMessage.add(ChatColor.translateAlternateColorCodes('&', line));
|
||||
@ -111,6 +115,10 @@ public class WelcomeMessageConfiguration implements Reloadable {
|
||||
* @return the lines of the welcome message file
|
||||
*/
|
||||
private List<String> readWelcomeFile() {
|
||||
if (!(service.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE))) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
File welcomeFile = new File(pluginFolder, "welcome.txt");
|
||||
if (copyFileFromResource(welcomeFile, "welcome.txt")) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user