if (i == currentIndex) {
if (playerTeam.getTeamConfig().resolveBoolean(TeamConfig.PLAYERLOADOUTASDEFAULT) && name.equals("default")) {
// Use player's own inventory as loadout
this.resetInventory(playerTeam, player, this.getPlayerInventoryFromSavedState(player));
} else if (isFirstRespawn && firstLoadout != null && name.equals("default")
&& (firstLoadout.requiresPermission() ? player.hasPermission(firstLoadout.getPermission()) : true)) {
// Get the loadout for the first spawn
this.resetInventory(playerTeam, player, Loadout.getLoadout(loadouts, "first").getContents());
} else {
// Use the loadout from the list in the settings
this.resetInventory(playerTeam, player, Loadout.getLoadout(loadouts, name).getContents());