Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,10 @@ private GriefPreventionUser(@NotNull UUID uuid, @NotNull Timestamp lastLogin, in
this.claimBlocks = claimBlocks;
this.spentClaimBlocks = spentClaimBlocks;

// Note the server may not have a cached name for a player, even if they have played before
final OfflinePlayer player = plugin.getServer().getOfflinePlayer(uuid);
if (player.hasPlayedBefore()) {
this.name = player.getName();
} else {
this.name = uuid.toString().substring(0, 8);
}
final String playerName = player.hasPlayedBefore() ? player.getName() : null;
this.name = playerName != null ? playerName : uuid.toString().substring(0, 8);
}

@NotNull
Expand Down