Move autoLoginFloodgate check to a common function
Reduces duplicate code. Added missing check for "no-conflict".
This commit is contained in:
3 files changed
+13
-7
No files matched your search
@@ -145,6 +145,17 @@ public abstract class FloodgateManagement<P extends C, C, L extends LoginSession
|
||||
|| ("linked".equals(autoRegisterFloodgate) && isLinked);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decide if the player can be auto logged in.
|
||||
* The config option 'non-conflicting' is ignored by this function.
|
||||
* @return true if the Player can be logged in automatically
|
||||
*/
|
||||
protected boolean isAutoLoginAllowed() {
|
||||
return "true".equals(autoLoginFloodgate)
|
||||
|| "no-conflict".equals(autoRegisterFloodgate) // this was checked before
|
||||
|| ("linked".equals(autoLoginFloodgate) && isLinked);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides wether checks for conflicting Java names should be made
|
||||
* @return ture if an API call to Mojang is needed
|
||||
|
||||
Reference in new issue
Block a user