@EventHandler public void onJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); event.setJoinMessage(null); if (!Skywars.getInstance().isSingleServerMode()) { player.setGameMode(GameMode.ADVENTURE); player.getInventory().clear(); player.setMaxHealth(20); player.setHealth(player.getMaxHealth()); player.setFoodLevel(25); player.teleport(Skywars.getInstance().getLobbyPoint()); } }
public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (hasPermission(player)) { /* if (Uranium.isLegacy()) { player.sendMessage(ChatColor.YELLOW + "We're running on legacy version on Uranium, please update your version"); } if (!Uranium.isOfficial()) { player.sendMessage(ChatColor.YELLOW + "We're running on non-official version on Uranium, please update your version"); } if (mHasUpdate) { sendUpdate(player); } */ } }
public void onPlayerJoin(PlayerJoinEvent event) { // When a player joins, add their correct values to the `playerVals` hashmap plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable() { // Run the database functions async public void run() { Player p = event.getPlayer(); UUID id = p.getUniqueId(); String uuid = id.toString(); PreparedStatement stmt = null; try { stmt = plugin.getDb().getConnection().prepareStatement("SELECT tse FROM life_system WHERE uuid = " + uuid + " LIMIT 1"); ResultSet set = stmt.executeQuery(); // Get the player with the UUID `uuid`'s life levels from the database set.next(); // Get the first matching row playerVals.put(id, set.getString("tse")); // Add the player's values to `playerVals` } catch (SQLException e) { e.printStackTrace(); } } ; }); }
@EventHandler public void onPlayerJoin(PlayerJoinEvent event) { if (onJoinActions.containsKey(event.getPlayer().getUniqueId())) { ProxyBlacklist blacklist = finders.get(event.getPlayer().getUniqueId()); plugin.getLogger().info("Player " + event.getPlayer().getName() + " connected with an open proxy at " + event.getPlayer().getAddress().getAddress().getHostAddress() + " as detected by " + blacklist.getName()); if (event.getPlayer().hasPermission("mopm.bypass")) { plugin.getLogger().info("Player " + event.getPlayer().getName() + " bypassed open proxy detection by permission"); } for (Predicate<Player> p : onJoinActions.get(event.getPlayer().getUniqueId())) { if (p.test(event.getPlayer())) { return; } } plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), blacklist.getDefaultCommand() .replace("%player%", event.getPlayer().getName()) .replace("%bl%", blacklist.getName())); } }
@EventHandler public void onJoin(PlayerJoinEvent event) { plugin.getPlayerManager().loadData(event.getPlayer()); if(event.getPlayer().hasPermission("asgardascension.staff")) { event.getPlayer().setPlayerListName(ChatColor.YELLOW + event.getPlayer().getDisplayName()); } // Restoring location, level and experience in case server crashed plugin.getPlayerFile().createConfig(event.getPlayer()); if(plugin.getPlayerFile().isInChallenge()) { Player player = event.getPlayer(); player.teleport(plugin.getPlayerFile().getChallengeLocation()); player.setLevel(plugin.getPlayerFile().getChallengeLevel()); player.setExp(plugin.getPlayerFile().getChallengeExperience()); plugin.getEconomy().depositPlayer(player, plugin.getPlayerFile().getChallengePrice()); plugin.getPlayerFile().removeChallenge(); plugin.getPlayerFile().saveConfig(); } }
@EventHandler(priority = EventPriority.HIGH) public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (Craft.reboardNames.containsKey(player.getName())) { if ((Craft.reboardNames.get(player.getName()) != null) && Craft.reboardNames.get(player.getName()).crewNames.contains(player.getName())) { Craft c = Craft.reboardNames.get(player.getName()); Location loc = new Location(c.world, c.minX + (c.sizeX / 2), c.maxY, c.minZ + (c.sizeZ / 2)); player.teleport(loc); } Craft.reboardNames.remove(player.getName()); } syp = (Shipyard)plugin.getServer().getPluginManager().getPlugin("NavyCraft-Shipyard"); if( syp != null ) { syp.playerJoin(player); } }
public void handlePlayerJoin( FlexPlayer player ) { this.players.put( player.getUuid(), player ); List<MessageS2EPlayerList.PlayerItem> items = new ArrayList<>(); for ( FlexPlayer target : this.getOnlinePlayers() ) { if( !target.equals( player ) ) { target.getConnectionHandler().sendMessage( new MessageS2EPlayerList( MessageS2EPlayerList.Action.ADD_PLAYER, Collections.singletonList( new MessageS2EPlayerList.PlayerItem().setUuid( player.getUuid() ).setName( player.getName() ).setGameMode( player.getGameMode() ).setPing( player.getLatency() ) ) ) ); } items.add( new MessageS2EPlayerList.PlayerItem().setName( target.getName() ).setUuid( target.getUuid() ).setGameMode( target.getGameMode() ).setPing( target.getLatency() ) ); } player.getConnectionHandler().sendMessage( new MessageS2EPlayerList( MessageS2EPlayerList.Action.ADD_PLAYER, items ) ); System.out.println( player.getName() + " (" + player.getUuid().toString() + ") logged in from " + player.getIpAddress() ); player.spawnPlayer(); player.getWorld().addEntity( player, true ); String joinMessage = EventFactory.call( new PlayerJoinEvent( player, "§e" + player.getName() + " joined the game." ) ).getJoinMessage(); if( joinMessage != null && !joinMessage.isEmpty() ) { Bukkit.broadcastMessage( joinMessage ); } }
@EventHandler(priority = EventPriority.HIGHEST) public void onJoin(PlayerJoinEvent e) { RagePlayer u = RageGames.getPlayer(e.getPlayer()); e.setJoinMessage(null); u.getPlayer().setFlySpeed(0.2f); u.getPlayer().setWalkSpeed(0.2f); if (plugin.getGm().isInLobby()) { u.getPlayer().getInventory().clear(); plugin.getGm().addPlayerToGame(u); plugin.getServer().getOnlinePlayers().forEach(p -> u.getPlayer().showPlayer(p)); plugin.getServer().getOnlinePlayers().forEach(p -> p.showPlayer(u.getPlayer())); u.setLobby(); Utils.broadcastMsg("&7Ha entrado al juego &e" + u.getName() + " &3(&b" + plugin.getGm().getPlaying().size() + "&d/&b" + plugin.getAm().getMaxPlayers() + "&3)"); plugin.getGm().checkStart(); plugin.getServer().getScheduler().runTaskLater(plugin, () -> u.sendToLobby(), 20); } else { new SpectatorTask(plugin, u).runTaskTimer(plugin, 0, 20); } }
@EventHandler public void onPlayerJoin(PlayerJoinEvent event){ Player player = event.getPlayer(); //Put player into database try { PreparedStatement stmt = plugin.getDb().getConnection().prepareStatement("SELECT * FROM users WHERE uuid = '"+player.getUniqueId().toString()+"' LIMIT 1"); ResultSet set = stmt.executeQuery(); if (!set.next()) { stmt.close(); stmt = plugin.getDb().getConnection().prepareStatement("INSERT INTO users (uuid, name) VALUES ('"+player.getUniqueId().toString()+"', '"+player.getName()+"')"); stmt.execute(); stmt.close(); } set.close(); } catch (SQLException e) { e.printStackTrace(); } pm.setup(player); try { String prfx = RankManager.getRankPrefix(player); player.setPlayerListName(ChatColor.translateAlternateColorCodes('&',prfx+" "+RankManager.getRankNameColor(player))+player.getName()); }catch(Exception err) {err.printStackTrace();} }
private Player registerPlayer() { Player player = mock(Player.class); when(player.getUniqueId()).thenReturn(UUID.randomUUID()); PlayerJoinEvent event = mock(PlayerJoinEvent.class); when(event.getPlayer()).thenReturn(player); this.manager.registerPlayer(event); return player; }
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (api.getGameManager().isLegacyPvP()) { AttributeInstance genericAttackSpeedAttribute = player.getAttribute(Attribute.GENERIC_ATTACK_SPEED); if (genericAttackSpeedAttribute != null) genericAttackSpeedAttribute.setBaseValue(1024.0D); } }
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent e){ if (!e.getPlayer().hasPlayedBefore()){ karmaUserManager.addNewKarmaUser(e.getPlayer()); } else { karmaUserManager.addKarmaUser(e.getPlayer()); } }
@EventHandler(ignoreCancelled=true, priority=EventPriority.LOWEST) public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); UUID uuid = player.getUniqueId(); for (PlayerBoard board : this.playerBoards.values()) { board.addUpdate(player); } PlayerBoard board2 = new PlayerBoard(this.plugin, player); Object c = Arrays.asList(Bukkit.getOnlinePlayers()); board2.addUpdates((Collection)c); setPlayerBoard(uuid, board2); }
@EventHandler //Join public void onJoin(PlayerJoinEvent e) { Player player = e.getPlayer(); if(Teams.getPlayerInWhereArea().containsKey(player)){ Teams.QuitTeam(player); } }
@EventHandler(ignoreCancelled=true, priority= EventPriority.MONITOR) /* */ public void onPlayerJoin(PlayerJoinEvent event) /* */ { /* 77 */ EntityPlayer entityPlayer = ((CraftPlayer)event.getPlayer()).getHandle(); /* 78 */ entityPlayer.knockbackReductionX = 0.6F; /* 79 */ entityPlayer.knockbackReductionY = 0.55F; /* 80 */ entityPlayer.knockbackReductionZ = 0.6F; /* */ }
@EventHandler public void onJoin(PlayerJoinEvent e){ /* CAVECLOUD API */ CaveCloud.gameAPI .setPlayers(Bukkit.getOnlinePlayers().size()) .update(); }
@EventHandler public void onPlayerJoin(PlayerJoinEvent e) { getServer().getScheduler().runTaskLater(this, () -> { Player p = e.getPlayer(); if (!p.isOnline()) return; GlowPlayer player = (GlowPlayer) p; GlowSession ses = player.getSession(); player.getWorld().getEntitiesByClass(GlowNPC.class) .forEach(npc -> ses.send(npc.getRemoveFromListMessage())); }, 15); }
public PacketScoreboard(@Nullable ExtendedJavaPlugin plugin) { this.protocolManager = ProtocolLibrary.getProtocolManager(); if (plugin != null) { Events.subscribe(PlayerJoinEvent.class).handler(this::handlePlayerJoin).bindWith(plugin); Events.subscribe(PlayerQuitEvent.class).handler(this::handlePlayerQuit).bindWith(plugin); } else { Events.subscribe(PlayerJoinEvent.class).handler(this::handlePlayerJoin); Events.subscribe(PlayerQuitEvent.class).handler(this::handlePlayerQuit); } }
@EventHandler public void onJoin(@Nonnull PlayerJoinEvent event) { Bukkit.getScheduler().runTaskLater(voxelGamesLib, () -> { if (gameHandler.getDefaultGame() != null) { gameHandler.getDefaultGame().join(userHandler.getUser(event.getPlayer().getUniqueId()).orElseThrow(() -> new UserException("Unknown user " + event.getPlayer().getDisplayName() + "(" + event.getPlayer().getUniqueId() + ")"))); } }, 10); }
@EventHandler(priority = EventPriority.LOWEST) public void cancelRestart(PlayerJoinEvent evt){ if(ConfigOptimize.emptyRestart) { Bukkit.getScheduler().cancelTask(restartTaskId); restartTaskId = -1; } }
@EventHandler public void onJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); PlaceHolderSetup(player); if (enableJoinMessage) { broadcastJoinMessage("chatassets.loghandler.joinmessage.receive", event); } if (player.hasPermission("chatassets.loghandler.motd.receive") && enableMotd) { sendMotd(player); } }
@EventHandler public void JoinEnableMonitor(PlayerJoinEvent event){ if(hasEnabled == false){ if(ConfigFunction.Monitorenable){ MonitorUtils.enable(); } hasEnabled = true; } }
@EventHandler(priority = EventPriority.HIGH) public void onPlayerJoin(PlayerJoinEvent e) { if (safeToProceed(e)) { mcb.getBot().getUpdatableMap().get("list").update(); SuperVanishHook svHook = HookContainer.getSuperVanishHook(); String msg = ChatColor.stripColor(e.getJoinMessage()); boolean isJoinBroadCast = configsManager.getBroadcastConfig().getBoolean("See_Player_Join"); boolean seeJoin = configsManager.getModChannelConfig().getBoolean("See_Player_Join"); if (seeJoin) { String m = msg; if (svHook != null) { boolean seeSV = configsManager.getModChannelConfig().getBoolean("See_SV"); if (VanishAPI.isInvisible(e.getPlayer()) || e.getJoinMessage().equals("Fake") && seeSV) m = "(Vanish) " + m; } messenger.sendMessageEmbedToAllModChannel(new EmbedBuilder().setColor(JOIN_COLOR) .setTitle(m, null).build()); } if (isJoinBroadCast) { if (e.getJoinMessage().equals("Fake")) { messenger.sendMessageEmbedToAllBoundChannel(new EmbedBuilder().setColor(JOIN_COLOR) .setTitle(msg, null).build()); e.setJoinMessage(""); } else if (check(e)) { messenger.sendMessageEmbedToAllBoundChannel(new EmbedBuilder().setColor(JOIN_COLOR) .setTitle(msg, null).build()); } } } }
/** * Gets called when a player joins a server. Overrides existing pets if enabled in the config.yml and * spawns the petblock of the player when his pet was enabled when he left the server the last time. * * @param event event */ @EventHandler public void playerJoinEvent(final PlayerJoinEvent event) { this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { final PetMeta petMeta; if (Config.getInstance().isJoin_enabled()) { if (!this.manager.getPetMetaController().getFromPlayer(event.getPlayer()).isPresent() || Config.getInstance().isJoin_overwriteExistingPet()) { if (event.getPlayer().getWorld() != null) { final PetMeta meta = this.manager.getPetMetaController().create(event.getPlayer()); Config.getInstance().fixJoinDefaultPet(meta); this.manager.getPetMetaController().store(meta); } } } if ((petMeta = PetBlocksApi.getDefaultPetMetaController().getByPlayer(event.getPlayer())) != null) { if (petMeta.isEnabled()) { this.plugin.getServer().getScheduler().runTaskLater(this.plugin, () -> { if (event.getPlayer().getWorld() != null) { final PetBlock petBlock = PetBlocksApi.getDefaultPetBlockController().create(event.getPlayer(), petMeta); PetBlocksApi.getDefaultPetBlockController().store(petBlock); } }, 2L); } } }); }
private boolean safeToProceed(PlayerEvent event) { boolean safe = true; if (event instanceof PlayerJoinEvent) { if (((PlayerJoinEvent) event).getJoinMessage() == null && ((PlayerJoinEvent) event).getJoinMessage().isEmpty()) { safe = false; Logger.warn("The previous PlayerJoinEvent message was missing!"); } } else if (event instanceof PlayerQuitEvent) { if (((PlayerQuitEvent) event).getQuitMessage() == null && ((PlayerQuitEvent) event).getQuitMessage().isEmpty()) { safe = false; Logger.warn("The previous PlayerQuitEvent message was missing!"); } } return safe; }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerShow(PlayerShowEvent event) { if (VanishAPI.getConfiguration().getBoolean("Configuration.Messages.VanishReappearMessages.BroadcastMessageOnReappear")) { PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(event.getPlayer(), "Fake"); Bukkit.getServer().getPluginManager().callEvent(playerJoinEvent); } }
@EventHandler public void onJoin(PlayerJoinEvent event) { event.setJoinMessage(null); Bukkit.getPluginManager().callEvent(new JoinEvent(PlayerManager.getInstance().register(event.getPlayer()))); event.getPlayer().setGameMode(GameMode.ADVENTURE); Main.getInstance().registerAddress(event.getPlayer()); }
@EventHandler private void onJoin(PlayerJoinEvent event) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, ClassNotFoundException { Player p = event.getPlayer(); if (this.worldEnvironments.containsKey(p.getWorld().getName())) Reflection.sendPacket(p, getPacket(p)); }
@EventHandler public void onJoinMod(PlayerJoinEvent event) { Player player = event.getPlayer(); if (player.hasPermission("rank.staff")) { enterMod(player); } }
@EventHandler public void onPlayerJoinEvent(PlayerJoinEvent event) { Player player = event.getPlayer(); new BukkitRunnable() { @Override public void run() { checkPlayer(player); } }.runTaskLaterAsynchronously(PracticePlugin.getInstance(), 4L); }
/** * When the player joins the server * <p> * SERVER JOIN */ @EventHandler(priority = EventPriority.HIGHEST) public void onJoin(PlayerJoinEvent event) { if(!Moo.getInstance().isConnected()) return; event.setJoinMessage(null); Player player = event.getPlayer(); PlayerData data = new PlayerData(); data.setUuid(player.getUniqueId()); data.setLastName(player.getName()); data.setLastIp(player.getAddress().getHostString()); // changes state Permissible oldPermissible = PermissionInjector.getPermissible(player); CustomPermissible customPermissible = new CustomPermissible(player, data.getUuid(), oldPermissible); PermissionInjector.inject(player, customPermissible); MooQueries.getInstance().changePlayerState(data, PacketPlayerState.State.JOIN_SERVER, response -> { }); // UPDATE SERVER INFO Lightning.getInstance().updateServerInfo(); // SET JOIN MESSAGE String playerName = MooQueries.getInstance().getGroup(player.getUniqueId()).getColor() + player.getName(); Bukkit.getServer().broadcastMessage(LanguageManager.get("join-message-pattern", playerName)); }
@EventHandler public void onJoin(PlayerJoinEvent e) { if(m.u.enabledingame) { if(m.u.update == true) { e.getPlayer().sendMessage("�6[�2Updater�6] �3Look at the console, there is an update for HeadGetter!"); }else{ e.getPlayer().sendMessage("�6[�2Updater�6] �3There isn't update for HeadGetter!"); } } }
@EventHandler private void onPlayerJoinEvent(PlayerJoinEvent e) { main.getPlayerManager().addMortuusPlayer(e.getPlayer()); if (!main.getScoreboards().isHostile(e.getPlayer())) main.getScoreboards().addPlayer(e.getPlayer(), "NEUTRAL"); }
@EventHandler public void onJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (!this.loggerEntities.containsKey(player.getName())) { return; } LoggerEntity logger = this.getLogger(player.getName()); logger.remove(null, LoggerRemoveReason.REJOIN); this.loggerEntities.remove(player.getName()); }
@EventHandler(priority = EventPriority.MONITOR) public void kickAbandonedPlayers(final PlayerJoinEvent event) { // Spawn module should add player to a match at a lower priority. // If that hasn't happened for some reason, kick the player. if(mm.getPlayer(event.getPlayer()) == null) { event.getPlayer().kickPlayer(net.md_5.bungee.api.ChatColor.RED + Translations.get().t("incorrectWorld.kickMessage", event.getPlayer())); logger.severe("Kicking " + event.getPlayer().getName() + " because they failed to join a match"); } }
@EventHandler(priority = EventPriority.HIGH) public void onPlayerJoin(final PlayerJoinEvent event) { final Player p = event.getPlayer(); manager.playerJoin(p); // Passer ça en sync si crash // Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { PermissionEntity user = api.getPermissionsManager().getPlayer(p.getUniqueId()); final String displayn = replaceColors(user.getTag() + "" + user.getPrefix()) + p.getName(); p.setDisplayName(displayn); }); }
@EventHandler public void onPlayerJoin(PlayerJoinEvent e) { if (cm.clientModDisabler) { Player p = e.getPlayer(); if (p.isOp() || p.hasPermission("neverlag.nosendmagiccode")) return; for (String code : cm.modMagicCode) { p.sendMessage(ChatColor.translateAlternateColorCodes('&', code)); } } }
@EventHandler(priority = EventPriority.HIGHEST) public void onJoin(PlayerJoinEvent event) { event.setJoinMessage(null); final User user = userStore.getUser(event.getPlayer()); final SessionChange change = pendingJoins.getIfPresent(user); if(change != null) { pendingJoins.invalidate(user); announce(change); } }
@SuppressWarnings("deprecation") @EventHandler public void onJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); showAllSleeping(player); if(!player.hasPlayedBefore()) { fatigue.getScore(player).setScore(0); } }