mirror of
https://github.com/BGHDDevelopment/PlayerBalancer.git
synced 2024-11-04 09:59:56 +01:00
Less console spam
This commit is contained in:
parent
c852c91f7a
commit
d351739564
@ -40,6 +40,7 @@ public class SectionManager {
|
||||
}
|
||||
|
||||
if (plugin.getSettings().getServerRefreshProps().isEnabled()) {
|
||||
plugin.getLogger().info("Starting automatic server refresh task");
|
||||
refreshTask = plugin.getProxy().getScheduler().schedule(plugin, () -> {
|
||||
props.getSectionProps().forEach((name, props) -> {
|
||||
ServerSection section = sections.get(name);
|
||||
@ -271,22 +272,26 @@ public class SectionManager {
|
||||
}
|
||||
});
|
||||
|
||||
results.forEach(server -> {
|
||||
int addedServers = 0;
|
||||
for (ServerInfo server : results) {
|
||||
if (!section.getServers().contains(server)) {
|
||||
section.getServers().add(server);
|
||||
register(server, section);
|
||||
addedServers++;
|
||||
plugin.getLogger().info(String.format("Added the server %s to %s",
|
||||
server.getName(), section.getName()
|
||||
));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (addedServers > 0) {
|
||||
plugin.getLogger().info(String.format("Recognized %s server%s in the section \"%s\"",
|
||||
results.size(),
|
||||
results.size() != 1 ? "s" : "",
|
||||
addedServers,
|
||||
addedServers != 1 ? "s" : "",
|
||||
section.getName()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
public int calculatePosition(ServerSection section) {
|
||||
ServerSection current = section;
|
||||
|
Loading…
Reference in New Issue
Block a user