Skip to content

Conversation

@Doc94
Copy link
Member

@Doc94 Doc94 commented Dec 30, 2025

Close #13467
This PR just mention in docs the behaviour for null player name and make the check in the method before the later check in addEntry.

You can test this with

this.getServer().getCommandMap().register("fallback", new BukkitCommand("test", "cool hi command", "<>", List.of()) {
            @Override
            public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) {
                if (sender instanceof Player player) {
                    Team team = player.getScoreboard().getTeam("DOC");
                    if (team == null) {
                        team = player.getScoreboard().registerNewTeam("DOC");
                    }
                    OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(UUID.fromString("00000000-0000-0000-0000-000000000000"));
                    player.sendMessage(Component.text("Offline player: " + offlinePlayer.getName()));
                    team.addPlayer(offlinePlayer);
                }
                return true;
            }
        });

@Doc94 Doc94 requested a review from a team as a code owner December 30, 2025 12:38
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Dec 30, 2025
@Doc94 Doc94 changed the title Team#addPlayer check for null player name Team add/remove Player check for null player name Dec 30, 2025
@Doc94 Doc94 changed the title Team add/remove Player check for null player name add check for null player name in Team methods Dec 30, 2025
@Warriorrrr Warriorrrr merged commit a47cb98 into PaperMC:main Jan 4, 2026
4 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting review to Merged in Paper PR Queue Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

Adding OfflinePayer with unresolved username to Team throws

4 participants