Add missing synchronized modifiers

This commit is contained in:
games647
2020-02-08 15:17:00 +01:00
parent 65469ed579
commit 109e19e6da
4 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,5 @@
package com.github.games647.fastlogin.bukkit;
import java.util.stream.Collectors;
import me.clip.placeholderapi.PlaceholderAPI;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
@ -43,7 +41,7 @@ public class PremiumPlaceholder extends PlaceholderExpansion {
@Override
public String getAuthor() {
return plugin.getDescription().getAuthors().stream().collect(Collectors.joining(", "));
return String.join(", ", plugin.getDescription().getAuthors());
}
@Override

View File

@ -29,10 +29,11 @@ public class BungeeLoginSource implements LoginSource {
public void kick(String message) {
preLoginEvent.setCancelled(true);
if (message != null)
preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
else
if (message == null) {
preLoginEvent.setCancelReason(new ComponentBuilder("Kicked").color(ChatColor.WHITE).create());
} else {
preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
}
}
@Override

View File

@ -23,6 +23,7 @@ import java.nio.file.Path;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@ -231,7 +232,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
Path configFile = dataFolder.resolve(fileName);
if (Files.notExists(configFile)) {
try (InputStream defaultStream = getClass().getClassLoader().getResourceAsStream(fileName)) {
Files.copy(defaultStream, configFile);
Files.copy(Objects.requireNonNull(defaultStream), configFile);
}
}
} catch (IOException ioExc) {

View File

@ -28,7 +28,7 @@ public abstract class LoginSession {
*
* @return
*/
public boolean needsRegistration() {
public synchronized boolean needsRegistration() {
return !registered;
}