use of com.almuradev.almura.feature.nick.network.ClientboundNucleusNameMappingsPacket in project Almura by AlmuraDev.
the class ServerNickManager method getMappingMessage.
private ClientboundNucleusNameMappingsPacket getMappingMessage(final NucleusNicknameService service) {
final Map<UUID, Text> nicknames = new HashMap<>();
this.game.getServer().getOnlinePlayers().forEach((player) -> {
Text nickname = service.getNickname(player).orElse(null);
if (nickname == null) {
nickname = Text.of(player.getName());
} else {
nickname = Text.of("~" + nickname.toPlain());
}
nicknames.put(player.getUniqueId(), nickname);
});
return new ClientboundNucleusNameMappingsPacket(nicknames);
}
Aggregations