Correctly wait for BungeeAuth loading by using the correct depend tag (Fixes #119)

This commit is contained in:
games647 committed 2017-02-10 19:06:57 +01:00
1 parent b8d029d6da
commit 70a81bfcdf
4 files changed
+12 -5

No files matched your search

@@ -6,6 +6,7 @@ import com.github.games647.fastlogin.bukkit.tasks.ForceLoginTask;
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
@@ -98,12 +99,14 @@ public class BungeeCordListener implements PluginMessageListener {
public Set<UUID> loadBungeeCordIds() {
Path whitelistFile = plugin.getDataFolder().toPath().resolve(FILE_NAME);
try {
if (!Files.exists(whitelistFile)) {
if (Files.notExists(whitelistFile)) {
Files.createFile(whitelistFile);
}
List<String> lines = Files.readAllLines(whitelistFile);
return lines.stream().map(String::trim).map(UUID::fromString).collect(Collectors.toSet());
return Files.readAllLines(whitelistFile).stream()
.map(String::trim)
.map(UUID::fromString)
.collect(Collectors.toSet());
} catch (IOException ex) {
plugin.getLogger().log(Level.SEVERE, "Failed to create file for Proxy whitelist", ex);
} catch (Exception ex) {