Fix set time

This commit is contained in:
Focusvity 2024-01-26 18:31:42 +11:00
parent 94ff2fa56e
commit dcee385ae5
No known key found for this signature in database
GPG Key ID: FC3BE6D52CCDB38F
3 changed files with 8 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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)

View File

@ -68,7 +68,7 @@ public class NUSHCommand extends PlexCommand
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.");
}