diff --git a/src/main/java/dev/plex/NUSHModule.java b/src/main/java/dev/plex/NUSHModule.java index 7c42338..e73f3f5 100644 --- a/src/main/java/dev/plex/NUSHModule.java +++ b/src/main/java/dev/plex/NUSHModule.java @@ -48,4 +48,10 @@ public class NUSHModule extends PlexModule enabled = toggle; config.set("server.enabled", toggle); } + + public static void setTime(int minutes) + { + time = minutes; + config.set("server.wait_time", minutes); + } } diff --git a/src/main/java/dev/plex/UserData.java b/src/main/java/dev/plex/UserData.java index ccbda6a..c5e3376 100644 --- a/src/main/java/dev/plex/UserData.java +++ b/src/main/java/dev/plex/UserData.java @@ -33,7 +33,7 @@ public class UserData USERS_MAP.remove(player.getUniqueId()); } }, - 20L * 60L * NUSHModule.getConfig().getInt("server.wait_time", 2)); + 20L * 60L * NUSHModule.getTime()); } public static boolean isNewPlayer(Player player) diff --git a/src/main/java/dev/plex/command/NUSHCommand.java b/src/main/java/dev/plex/command/NUSHCommand.java index 99faf3d..5af0606 100644 --- a/src/main/java/dev/plex/command/NUSHCommand.java +++ b/src/main/java/dev/plex/command/NUSHCommand.java @@ -68,7 +68,7 @@ public class NUSHCommand extends PlexCommand return MiniMessage.miniMessage().deserialize("The time must be a number!"); } - NUSHModule.getConfig().set("server.wait_time", time); + NUSHModule.setTime(time); return MiniMessage.miniMessage().deserialize("The wait time for new players before they can chat is now set to " + time + " minutes."); }