Minor refactoring
This commit is contained in:
14 files changed
+52
-56
No files matched your search
@@ -23,7 +23,6 @@ import java.security.KeyPair;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -127,7 +126,6 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
||||
ChannelMessage message = new ChangePremiumMessage(target, activate, true);
|
||||
sendPluginMessage((PluginMessageRecipient) invoker, message);
|
||||
} else {
|
||||
|
||||
Optional<? extends Player> optPlayer = getServer().getOnlinePlayers().stream().findFirst();
|
||||
if (!optPlayer.isPresent()) {
|
||||
logger.info("No player online to send a plugin message to the proxy");
|
||||
@@ -204,12 +202,6 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin<Comman
|
||||
receiver.sendMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThreadFactory getThreadFactory() {
|
||||
//not required here to make a custom thread factory
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MojangApiConnector makeApiConnector(List<String> addresses, int requests, List<HostAndPort> proxies) {
|
||||
return new MojangApiBukkit(logger, addresses, requests, proxies);
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.github.games647.fastlogin.bukkit.hooks;
|
||||
|
||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||
import com.github.games647.fastlogin.core.hooks.AuthPlugin;
|
||||
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* GitHub: https://github.com/Xephi/AuthMeReloaded/
|
||||
@@ -17,23 +15,16 @@ import org.bukkit.event.Listener;
|
||||
* <p>
|
||||
* Spigot: https://www.spigotmc.org/resources/authme-reloaded.6269/
|
||||
*/
|
||||
public class AuthMeHook implements AuthPlugin<Player>, Listener {
|
||||
|
||||
private final FastLoginBukkit plugin;
|
||||
|
||||
public AuthMeHook(FastLoginBukkit plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
public class AuthMeHook implements AuthPlugin<Player> {
|
||||
|
||||
@Override
|
||||
public boolean forceLogin(Player player) {
|
||||
//skips registration and login
|
||||
if (AuthMeApi.getInstance().isAuthenticated(player)) {
|
||||
return false;
|
||||
} else {
|
||||
AuthMeApi.getInstance().forceLogin(player);
|
||||
}
|
||||
|
||||
AuthMeApi.getInstance().forceLogin(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user