Move Bungee connection event registerIntent call to after possible method return

This commit is contained in:
Luck 2020-04-04 12:04:22 +01:00
parent 9f0fe9e0cb
commit efb958ba44
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -60,10 +60,6 @@ public class BungeeConnectionListener extends AbstractConnectionListener impleme
This means that a player will have the same UUID across the network, even if parts of the network are running in This means that a player will have the same UUID across the network, even if parts of the network are running in
Offline mode. */ Offline mode. */
/* registers the plugins intent to modify this events state going forward.
this will prevent the event from completing until we're finished handling. */
e.registerIntent(this.plugin.getBootstrap());
final PendingConnection c = e.getConnection(); final PendingConnection c = e.getConnection();
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) { if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
@ -76,6 +72,10 @@ public class BungeeConnectionListener extends AbstractConnectionListener impleme
return; return;
} }
/* registers the plugins intent to modify this events state going forward.
this will prevent the event from completing until we're finished handling. */
e.registerIntent(this.plugin.getBootstrap());
this.plugin.getBootstrap().getScheduler().executeAsync(() -> { this.plugin.getBootstrap().getScheduler().executeAsync(() -> {
/* Actually process the login for the connection. /* Actually process the login for the connection.
We do this here to delay the login until the data is ready. We do this here to delay the login until the data is ready.