2525 */
2626package com .github .games647 .fastlogin .core .shared ;
2727
28+ import com .github .games647 .craftapi .model .Profile ;
29+ import com .github .games647 .craftapi .resolver .RateLimitException ;
30+ import com .github .games647 .fastlogin .core .StoredProfile ;
31+ import com .github .games647 .fastlogin .core .hooks .AuthPlugin ;
32+
2833import java .io .IOException ;
2934import java .net .InetSocketAddress ;
3035import java .util .Optional ;
3136import java .util .UUID ;
3237
3338import org .geysermc .floodgate .api .player .FloodgatePlayer ;
3439
35- import com .github .games647 .craftapi .model .Profile ;
36- import com .github .games647 .craftapi .resolver .RateLimitException ;
37- import com .github .games647 .fastlogin .core .StoredProfile ;
38- import com .github .games647 .fastlogin .core .hooks .AuthPlugin ;
39-
4040public abstract class FloodgateManagement <P extends C , C , L extends LoginSession , T extends PlatformPlugin <C >>
4141 implements Runnable {
4242
@@ -69,20 +69,18 @@ public FloodgateManagement(FastLoginCore<P, C, T> core, P player, FloodgatePlaye
6969
7070 @ Override
7171 public void run () {
72- core .getPlugin ().getLog ().info (
73- "Player {} is connecting through Geyser Floodgate." ,
74- username );
72+ core .getPlugin ().getLog ().info ("Player {} is connecting through Geyser Floodgate." , username );
7573
7674 // check if the Bedrock player is linked to a Java account
7775 isLinked = floodgatePlayer .getLinkedPlayer () != null ;
7876 AuthPlugin <P > authPlugin = core .getAuthPluginHook ();
7977
8078 try {
8179 isRegistered = authPlugin .isRegistered (username );
82- } catch (Exception e ) {
80+ } catch (Exception ex ) {
8381 core .getPlugin ().getLog ().error (
8482 "An error has occured while checking if player {} is registered" ,
85- username );
83+ username , ex );
8684 return ;
8785 }
8886
@@ -94,8 +92,8 @@ public void run() {
9492 premiumUUID = core .getResolver ().findProfile (username );
9593 } catch (IOException | RateLimitException e ) {
9694 core .getPlugin ().getLog ().error (
97- "Could not check wether Floodgate Player {}'s name conflits a premium Java account's name." ,
98- username );
95+ "Could not check whether Floodgate Player {}'s name conflicts a premium Java account's name." ,
96+ username , e );
9997 return ;
10098 }
10199
@@ -126,9 +124,9 @@ public void run() {
126124 * @return true if the Player can be registered automatically
127125 */
128126 private boolean isAutoRegisterAllowed () {
129- return autoRegisterFloodgate . equals ( "true" )
130- || autoRegisterFloodgate . equals ( "no-conflict" ) // this was checked before
131- || (autoRegisterFloodgate . equals ( "linked" ) && isLinked );
127+ return "true" . equals ( autoRegisterFloodgate )
128+ || "no-conflict" . equals ( autoRegisterFloodgate ) // this was checked before
129+ || ("linked" . equals ( autoRegisterFloodgate ) && isLinked );
132130 }
133131
134132 /**
@@ -140,16 +138,16 @@ private boolean isNameCheckRequired() {
140138 //OR
141139 //if allowNameConflict is 'false' or 'linked' and the player had a conflicting
142140 //name, than they would have been kicked in FloodgateHook#checkNameConflict
143- if (isLinked || !allowNameConflict . equals ( "true" )) {
141+ if (isLinked || !"true" . equals ( allowNameConflict )) {
144142 return false ;
145143 }
146144
147145 //autoRegisterFloodgate should only be checked if then player is not yet registered
148- if (!isRegistered && autoRegisterFloodgate . equals ( "no-conflict" )) {
146+ if (!isRegistered && "no-conflict" . equals ( autoRegisterFloodgate )) {
149147 return true ;
150148 }
151149
152- return autoLoginFloodgate . equals ( "no-conflict" );
150+ return "no-conflict" . equals ( autoLoginFloodgate );
153151 }
154152
155153 protected abstract void startLogin ();
0 commit comments