@Override public void onPlayerJoin(final PlayerJoinEvent event) { final User user = ess.getUser(event.getPlayer()); if (!user.isNew() || user.getBedSpawnLocation() != null) { return; } user.setNew(false); if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) { ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user)); } if (ess.getSettings().getAnnounceNewPlayers()) { ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user)); } }
@Override public void onPlayerJoin(final PlayerJoinEvent event) { final User user = ess.getUser(event.getPlayer()); if (user.hasPlayedBefore()) { LOGGER.log(Level.FINE, "Old player join"); return; } if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) { ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L); } if (ess.getSettings().getAnnounceNewPlayers()) { ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user)); } LOGGER.log(Level.FINE, "New player join"); }
public void onPlayerJoin(final PlayerJoinEvent event) { if (event.getPlayer().hasPlayedBefore()) { LOGGER.log(Level.FINE, "Old player join"); return; } final User user = ess.getUser(event.getPlayer()); if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) { ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L); } if (ess.getSettings().getAnnounceNewPlayers()) { final IText output = new KeywordReplacer(ess.getSettings().getAnnounceNewPlayerFormat(), user, ess); final SimpleTextPager pager = new SimpleTextPager(output); ess.broadcastMessage(user, pager.getString(0)); } final String kitName = ess.getSettings().getNewPlayerKit(); if (!kitName.isEmpty()) { try { final Map<String, Object> kit = ess.getSettings().getKit(kitName.toLowerCase(Locale.ENGLISH)); final List<String> items = Kit.getItems(user, kit); Kit.expandItems(ess, user, items); } catch (Exception ex) { LOGGER.log(Level.WARNING, ex.getMessage()); } } LOGGER.log(Level.FINE, "New player join"); }