Use Override for non core code in FloodgateAuthTas

This commit is contained in:
Smart123s
2021-06-20 13:35:31 +02:00
parent 9350f52916
commit fd3da28bec
3 changed files with 5 additions and 16 deletions

View File

@ -45,13 +45,7 @@ public class FloodgateAuthTask extends FloodgateManagement<Player, CommandSender
}
@Override
public void run() {
super.run();
if (!performLogin) {
return;
}
protected void startLogin() {
BukkitLoginSession session = new BukkitLoginSession(player.getName(), isRegistered, profile);
// enable auto login based on the value of 'autoLoginFloodgate' in config.yml

View File

@ -51,13 +51,7 @@ public class FloodgateAuthTask
}
@Override
public void run() {
super.run();
if (!performLogin) {
return;
}
protected void startLogin() {
BungeeLoginSession session = new BungeeLoginSession(player.getName(), isRegistered, profile);
// enable auto login based on the value of 'autoLoginFloodgate' in config.yml

View File

@ -54,7 +54,6 @@ public abstract class FloodgateManagement<P extends C, C, L extends LoginSession
protected boolean isRegistered;
protected StoredProfile profile;
protected boolean isLinked;
protected boolean performLogin; //will be set to ture if core#run() wasn't interrupted by a return;
public FloodgateManagement(FastLoginCore<P, C, T> core, P player, FloodgatePlayer floodgatePlayer) {
this.core = core;
@ -116,7 +115,8 @@ public abstract class FloodgateManagement<P extends C, C, L extends LoginSession
profile = new StoredProfile(getUUID(player), username, true, getAddress(player).toString());
}
performLogin = true;
//start Bukkit/Bungee specific tasks
startLogin();
}
@ -141,6 +141,7 @@ public abstract class FloodgateManagement<P extends C, C, L extends LoginSession
return autoLoginFloodgate.equals("no-conflict");
}
protected abstract void startLogin();
protected abstract String getName(P player);
protected abstract UUID getUUID(P player);
protected abstract InetSocketAddress getAddress(P player);