#517 Display welcome message for all logins

This commit is contained in:
ljacqu 2016-02-20 08:23:02 +01:00
parent 614d544edf
commit fd89915071

View File

@ -2,6 +2,8 @@ package fr.xephi.authme.process.login;
import fr.xephi.authme.settings.NewSetting; import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.HooksSettings;
import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.settings.properties.RestrictionSettings;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -92,7 +94,7 @@ public class ProcessSyncPlayerLogin implements Runnable {
} }
private void restoreSpeedEffects() { private void restoreSpeedEffects() {
if (Settings.isRemoveSpeedEnabled) { if (settings.getProperty(RestrictionSettings.REMOVE_SPEED)) {
player.setWalkSpeed(0.2F); player.setWalkSpeed(0.2F);
player.setFlySpeed(0.1F); player.setFlySpeed(0.1F);
} }
@ -173,19 +175,19 @@ public class ProcessSyncPlayerLogin implements Runnable {
} }
restoreSpeedEffects(); restoreSpeedEffects();
if (Settings.applyBlindEffect) { if (settings.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) {
player.removePotionEffect(PotionEffectType.BLINDNESS); player.removePotionEffect(PotionEffectType.BLINDNESS);
} }
// The Login event now fires (as intended) after everything is processed // The Login event now fires (as intended) after everything is processed
Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player)); Bukkit.getServer().getPluginManager().callEvent(new LoginEvent(player));
player.saveData(); player.saveData();
if (Settings.bungee) { if (settings.getProperty(HooksSettings.BUNGEECORD)) {
sendBungeeMessage(); sendBungeeMessage();
} }
// Login is finish, display welcome message if we use email registration // Login is done, display welcome message
if (Settings.useWelcomeMessage && Settings.emailRegistration) { if (settings.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE)) {
if (Settings.broadcastWelcomeMessage) { if (settings.getProperty(RegistrationSettings.BROADCAST_WELCOME_MESSAGE)) {
for (String s : settings.getWelcomeMessage()) { for (String s : settings.getWelcomeMessage()) {
Bukkit.getServer().broadcastMessage(plugin.replaceAllInfo(s, player)); Bukkit.getServer().broadcastMessage(plugin.replaceAllInfo(s, player));
} }