mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 15:17:56 +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
|
@PostConstruct
|
||||||
@Override
|
@Override
|
||||||
public void reload() {
|
public void reload() {
|
||||||
|
if (!(service.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> welcomeMessage = new ArrayList<>();
|
List<String> welcomeMessage = new ArrayList<>();
|
||||||
for (String line : readWelcomeFile()) {
|
for (String line : readWelcomeFile()) {
|
||||||
welcomeMessage.add(ChatColor.translateAlternateColorCodes('&', line));
|
welcomeMessage.add(ChatColor.translateAlternateColorCodes('&', line));
|
||||||
@ -111,6 +115,10 @@ public class WelcomeMessageConfiguration implements Reloadable {
|
|||||||
* @return the lines of the welcome message file
|
* @return the lines of the welcome message file
|
||||||
*/
|
*/
|
||||||
private List<String> readWelcomeFile() {
|
private List<String> readWelcomeFile() {
|
||||||
|
if (!(service.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE))) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
File welcomeFile = new File(pluginFolder, "welcome.txt");
|
File welcomeFile = new File(pluginFolder, "welcome.txt");
|
||||||
if (copyFileFromResource(welcomeFile, "welcome.txt")) {
|
if (copyFileFromResource(welcomeFile, "welcome.txt")) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user