From 871acc2eeb929423f3e4a7fda253da6642497546 Mon Sep 17 00:00:00 2001 From: Video Date: Tue, 10 Aug 2021 04:13:23 -0600 Subject: [PATCH] Actually, let's make it possible to disable it if needed --- .../me/totalfreedom/totalfreedommod/LoginProcess.java | 2 +- .../totalfreedom/totalfreedommod/config/ConfigEntry.java | 3 ++- src/main/resources/config.yml | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java b/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java index 6b655a59..0a1f56dd 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/LoginProcess.java @@ -192,7 +192,7 @@ public class LoginProcess extends FreedomService 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()) + if (!event.getPlayer().hasPlayedBefore() && ConfigEntry.FIRST_JOIN_INFO_ENABLED.getBoolean()) { final BukkitTask runnable = new BukkitRunnable() { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java index 2eca28be..021f30f1 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java @@ -165,7 +165,8 @@ 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"), + FIRST_JOIN_INFO(List.class, "first_join_info.text"), + FIRST_JOIN_INFO_ENABLED(Boolean.class, "first_join_info.enabled"), 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 4c2a39ba..bba2c44a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -592,9 +592,11 @@ masterbuilderinfo: # 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!" + enabled: true + text: + - "&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: