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 static void toggle(boolean toggle) 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 static void queueNewPlayer(Player player) 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 @@ else if (args.length == 2) 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."); }