Source:
<code>public void processJoin(final Player player) { final String name = player.getName().toLowerCase(); final String ip = PlayerUtils.getPlayerIp(player); if (service.getProperty(RestrictionSettings.UNRESTRICTED_NAMES).contains(name)) { return; } if (service.getProperty(RestrictionSettings.FORCE_SURVIVAL_MODE) && !service.hasPermission(player, PlayerStatePermission.BYPASS_FORCE_SURVIVAL) <START> && player.getGameMode() != GameMode.SURVIVAL) { <END> bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> player.setGameMode(GameMode.SURVIVAL)); } if (service.getProperty(HooksSettings.DISABLE_SOCIAL_SPY)) { pluginHookService.setEssentialsSocialSpyStatus(player, false); } if (!validationService.fulfillsNameRestrictions(player)) { handlePlayerWithUnmetNameRestriction(player, ip); return; } if (!validatePlayerCountForIp(player, ip)) { return; } final boolean isAuthAvailable = database.isAuthAvailable(name); if (isAuthAvailable) { if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { ProtectInventoryEvent ev = bukkitService.createAndCallEvent( isAsync -> new ProtectInventoryEvent(player, isAsync)); if (ev.isCancelled()) { player.updateInventory(); logger.fine("ProtectInventoryEvent has been cancelled for " + player.getName() + "..."); } } if (sessionService.canResumeSession(player)) { service.send(player, MessageKey.SESSION_RECONNECTION); bukkitService.scheduleSyncTaskFromOptionallyAsyncTask( () -> commandManager.runCommandsOnSessionLogin(player)); bukkitService.runTaskOptionallyAsync(() -> asynchronousLogin.forceLogin(player)); return; } } else if (!service.getProperty(RegistrationSettings.FORCE)) { bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> { welcomeMessageConfiguration.sendWelcomeMessage(player); }); return; } processJoinSync(player, isAuthAvailable); }</code><technical_language>This is nice-if want micro optimize more guessing checking game mode is cheaper checking permission :wink:</technical_language>

Target:
public void processJoin(final Player player) { final String name = player.getName().toLowerCase(); final String ip = PlayerUtils.getPlayerIp(player); if (service.getProperty(RestrictionSettings.UNRESTRICTED_NAMES).contains(name)) { return; } if (service.getProperty(RestrictionSettings.FORCE_SURVIVAL_MODE) && player.getGameMode() != GameMode.SURVIVAL && !service.hasPermission(player, PlayerStatePermission.BYPASS_FORCE_SURVIVAL)) { bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> player.setGameMode(GameMode.SURVIVAL)); } if (service.getProperty(HooksSettings.DISABLE_SOCIAL_SPY)) { pluginHookService.setEssentialsSocialSpyStatus(player, false); } if (!validationService.fulfillsNameRestrictions(player)) { handlePlayerWithUnmetNameRestriction(player, ip); return; } if (!validatePlayerCountForIp(player, ip)) { return; } final boolean isAuthAvailable = database.isAuthAvailable(name); if (isAuthAvailable) { if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { ProtectInventoryEvent ev = bukkitService.createAndCallEvent( isAsync -> new ProtectInventoryEvent(player, isAsync)); if (ev.isCancelled()) { player.updateInventory(); logger.fine("ProtectInventoryEvent has been cancelled for " + player.getName() + "..."); } } if (sessionService.canResumeSession(player)) { service.send(player, MessageKey.SESSION_RECONNECTION); bukkitService.scheduleSyncTaskFromOptionallyAsyncTask( () -> commandManager.runCommandsOnSessionLogin(player)); bukkitService.runTaskOptionallyAsync(() -> asynchronousLogin.forceLogin(player)); return; } } else if (!service.getProperty(RegistrationSettings.FORCE)) { bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> { welcomeMessageConfiguration.sendWelcomeMessage(player); }); return; } processJoinSync(player, isAuthAvailable); }