#1046 Add onFirstLogin to commands.yml

- Allow to configure commands run on player's first login (login of player with a previously null lastlogin date)
This commit is contained in:
ljacqu
2017-11-28 21:41:30 +01:00
parent 7932c1bf90
commit f1c1848985
10 changed files with 65 additions and 10 deletions
@@ -62,7 +62,13 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess {
}
}
public void processPlayerLogin(Player player) {
/**
* Performs operations in sync mode for a player that has just logged in.
*
* @param player the player that was logged in
* @param isFirstLogin true if this is the first time the player logged in
*/
public void processPlayerLogin(Player player, boolean isFirstLogin) {
final String name = player.getName().toLowerCase();
final LimboPlayer limbo = limboService.getLimboPlayer(name);
@@ -93,6 +99,9 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess {
welcomeMessageConfiguration.sendWelcomeMessage(player);
// Login is now finished; we can force all commands
if (isFirstLogin) {
commandManager.runCommandsOnFirstLogin(player);
}
commandManager.runCommandsOnLogin(player);
// Send Bungee stuff. The service will check if it is enabled or not.