mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Add missing synchronized modifiers
This commit is contained in:
@ -1,7 +1,5 @@
|
|||||||
package com.github.games647.fastlogin.bukkit;
|
package com.github.games647.fastlogin.bukkit;
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
|
|
||||||
@ -43,7 +41,7 @@ public class PremiumPlaceholder extends PlaceholderExpansion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAuthor() {
|
public String getAuthor() {
|
||||||
return plugin.getDescription().getAuthors().stream().collect(Collectors.joining(", "));
|
return String.join(", ", plugin.getDescription().getAuthors());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -29,10 +29,11 @@ public class BungeeLoginSource implements LoginSource {
|
|||||||
public void kick(String message) {
|
public void kick(String message) {
|
||||||
preLoginEvent.setCancelled(true);
|
preLoginEvent.setCancelled(true);
|
||||||
|
|
||||||
if (message != null)
|
if (message == null) {
|
||||||
preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
|
|
||||||
else
|
|
||||||
preLoginEvent.setCancelReason(new ComponentBuilder("Kicked").color(ChatColor.WHITE).create());
|
preLoginEvent.setCancelReason(new ComponentBuilder("Kicked").color(ChatColor.WHITE).create());
|
||||||
|
} else {
|
||||||
|
preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -23,6 +23,7 @@ import java.nio.file.Path;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
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);
|
Path configFile = dataFolder.resolve(fileName);
|
||||||
if (Files.notExists(configFile)) {
|
if (Files.notExists(configFile)) {
|
||||||
try (InputStream defaultStream = getClass().getClassLoader().getResourceAsStream(fileName)) {
|
try (InputStream defaultStream = getClass().getClassLoader().getResourceAsStream(fileName)) {
|
||||||
Files.copy(defaultStream, configFile);
|
Files.copy(Objects.requireNonNull(defaultStream), configFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException ioExc) {
|
} catch (IOException ioExc) {
|
||||||
|
@ -28,7 +28,7 @@ public abstract class LoginSession {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean needsRegistration() {
|
public synchronized boolean needsRegistration() {
|
||||||
return !registered;
|
return !registered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user