Less console spam

This commit is contained in:
Jaime Martínez Rincón 2017-09-27 19:31:23 +02:00
parent c852c91f7a
commit d351739564

View File

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