use of com.djrapitops.plan.exceptions.MissingPipelineException in project Plan by plan-player-analytics.
the class BukkitEventPipelineModule method mapToPlayerJoin.
private PlayerJoin mapToPlayerJoin(DataService service, PlayerJoinEvent event) {
UUID playerUUID = event.getPlayer().getUniqueId();
Optional<PlayerMetadata> metadata = service.map(playerUUID, event.getPlayer(), PlayerMetadata.class);
return PlayerJoin.builder().playerUUID(playerUUID).serverUUID(service.pullWithoutId(ServerUUID.class).orElseThrow(MissingPipelineException::new)).playerMetadata(metadata.orElseThrow(MissingPipelineException::new)).time(System.currentTimeMillis()).build();
}
use of com.djrapitops.plan.exceptions.MissingPipelineException in project Plan by plan-player-analytics.
the class BukkitEventPipelineModule method mapToPlayerLeave.
private PlayerLeave mapToPlayerLeave(DataService service, PlayerQuitEvent event) {
UUID playerUUID = event.getPlayer().getUniqueId();
Optional<PlayerMetadata> metadata = service.map(playerUUID, event.getPlayer(), PlayerMetadata.class);
return PlayerLeave.builder().playerUUID(playerUUID).serverUUID(service.pullWithoutId(ServerUUID.class).orElseThrow(MissingPipelineException::new)).playerMetadata(metadata.orElseThrow(MissingPipelineException::new)).time(System.currentTimeMillis()).build();
}
Aggregations