diff --git a/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java b/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java index 015cb064..6b655a59 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java @@ -19,6 +19,7 @@ import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.scheduler.BukkitTask; public class LoginProcess extends FreedomService { @@ -190,6 +191,22 @@ public class LoginProcess extends FreedomService final FPlayer fPlayer = plugin.pl.getPlayer(player); final PlayerData playerData = plugin.pl.getData(player); + // Sends a message to the player if they have never joined before (or simply lack player data). + if (!event.getPlayer().hasPlayedBefore()) + { + final BukkitTask runnable = new BukkitRunnable() + { + @Override + public void run() + { + for (String line : ConfigEntry.FIRST_JOIN_INFO.getStringList()) + { + player.sendMessage(FUtil.colorize(line)); + } + } + }.runTaskLater(plugin, 20); + } + player.sendTitle(FUtil.colorize(ConfigEntry.SERVER_LOGIN_TITLE.getString()), FUtil.colorize(ConfigEntry.SERVER_LOGIN_SUBTITLE.getString()), 20, 100, 60); player.setOp(true); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java index 05051905..2eca28be 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java @@ -165,6 +165,7 @@ public enum ConfigEntry ADMIN_INFO(List.class, "admininfo"), VOTING_INFO(List.class, "votinginfo"), MASTER_BUILDER_INFO(List.class, "masterbuilderinfo"), + FIRST_JOIN_INFO(List.class, "first_join_info"), AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"), TOGGLE_CHAT(Boolean.class, "toggle_chat"), DEVELOPER_MODE(Boolean.class, "developer_mode"), diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3780220d..4c2a39ba 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -590,6 +590,12 @@ masterbuilderinfo: - ' &2- Template:' - '&9https://forum.totalfreedom.me/d/336-master-builder-application-process' +# What new players will see upon joining for the first time. +first_join_info: + - "&6Welcome to TotalFreedom -- the original Free-OP server!" + - "&eThe server's name doesn't mean we have no rules. Do &6/rules &efor a list of them." + - "&aNeed help getting started? Do &2/help &aor a list of commands!" + # Famous players - cannot be banned by username famous_players: - honeydew