Fix some minor configuration issues #1344
This commit is contained in:
@@ -15,6 +15,7 @@ import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.service.PluginHookService;
|
||||
import fr.xephi.authme.service.ValidationService;
|
||||
import fr.xephi.authme.settings.WelcomeMessageConfiguration;
|
||||
import fr.xephi.authme.settings.commandconfig.CommandManager;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
@@ -68,6 +69,9 @@ public class AsynchronousJoin implements AsynchronousProcess {
|
||||
@Inject
|
||||
private ValidationService validationService;
|
||||
|
||||
@Inject
|
||||
private WelcomeMessageConfiguration welcomeMessageConfiguration;
|
||||
|
||||
AsynchronousJoin() {
|
||||
}
|
||||
|
||||
@@ -126,6 +130,8 @@ public class AsynchronousJoin implements AsynchronousProcess {
|
||||
return;
|
||||
}
|
||||
} else if (!service.getProperty(RegistrationSettings.FORCE)) {
|
||||
welcomeMessageConfiguration.sendWelcomeMessage(player);
|
||||
|
||||
// Skip if registration is optional
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.List;
|
||||
|
||||
import static fr.xephi.authme.settings.properties.RestrictionSettings.PROTECT_INVENTORY_BEFORE_LOGIN;
|
||||
|
||||
@@ -91,14 +90,7 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess {
|
||||
player.saveData();
|
||||
|
||||
// Login is done, display welcome message
|
||||
List<String> welcomeMessage = welcomeMessageConfiguration.getWelcomeMessage(player);
|
||||
if (commonService.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE)) {
|
||||
if (commonService.getProperty(RegistrationSettings.BROADCAST_WELCOME_MESSAGE)) {
|
||||
welcomeMessage.forEach(bukkitService::broadcastMessage);
|
||||
} else {
|
||||
welcomeMessage.forEach(player::sendMessage);
|
||||
}
|
||||
}
|
||||
welcomeMessageConfiguration.sendWelcomeMessage(player);
|
||||
|
||||
// Login is now finished; we can force all commands
|
||||
commandManager.runCommandsOnLogin(player);
|
||||
|
||||
Reference in New Issue
Block a user