@@ -268,7 +268,9 @@ public void performCleanup() {
268268
269269 /**
270270 * Finalizes a pending premium verification: saves the confirmed Mojang UUID to the database,
271- * updates the player cache, notifies the proxy, and sends a success message to the player.
271+ * notifies the proxy, and sends a success message to the player.
272+ * Does NOT update the player cache — the player is not yet logged in at this point;
273+ * the subsequent forceLogin() call will add them to the cache once authentication completes.
272274 * Must be called from an async context.
273275 *
274276 * @param player the player whose premium status is being confirmed
@@ -284,13 +286,20 @@ public void finalizePendingPremium(Player player, UUID confirmedUuid) {
284286 logger .warning ("Could not finalize pending premium for " + playerName + ": no auth record found" );
285287 return ;
286288 }
287- storePremiumUuid (auth , confirmedUuid , player , playerName );
289+ storePremiumUuid (auth , confirmedUuid , player , playerName , false );
288290 }
289291
290292 private void storePremiumUuid (PlayerAuth auth , UUID uuid , CommandSender feedbackTarget , String playerName ) {
293+ storePremiumUuid (auth , uuid , feedbackTarget , playerName , true );
294+ }
295+
296+ private void storePremiumUuid (PlayerAuth auth , UUID uuid , CommandSender feedbackTarget , String playerName ,
297+ boolean updateCache ) {
291298 auth .setPremiumUuid (uuid );
292299 if (dataSource .updatePremiumUuid (auth )) {
293- playerCache .updatePlayer (auth );
300+ if (updateCache ) {
301+ playerCache .updatePlayer (auth );
302+ }
294303 bungeeSender .sendPremiumSet (playerName );
295304 messages .send (feedbackTarget , MessageKey .PREMIUM_ENABLE_SUCCESS );
296305 } else {
0 commit comments