Skip to content

Commit

Permalink
Fix set time
Browse files Browse the repository at this point in the history
  • Loading branch information
Focusvity committed Jan 26, 2024
1 parent 94ff2fa commit dcee385
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/main/java/dev/plex/NUSHModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/main/java/dev/plex/UserData.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/plex/command/NUSHCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ else if (args.length == 2)
return MiniMessage.miniMessage().deserialize("<red>The time must be a number!");
}

NUSHModule.getConfig().set("server.wait_time", time);
NUSHModule.setTime(time);
return MiniMessage.miniMessage().deserialize("<gray>The wait time for new players before they can chat is now set to <yellow>" + time + "</yellow> minutes.");
}

Expand Down

0 comments on commit dcee385

Please sign in to comment.