Java 类org.bukkit.event.player.PlayerJoinEvent 实例源码

项目:SkywarsSeries    文件:PlayerJoin.java   
@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());
    }
}
项目:Uranium    文件:DefaultUpdateCallback.java   
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);
        }
        */
    }
}
项目:Locked    文件:LifeSystem.java   
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();
            }

        }

        ;
    });
}
项目:mopm    文件:ConnectionListener.java   
@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()));
    }
}
项目:AsgardAscension    文件:PlayerListener.java   
@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();
    }
}
项目:NavyCraft2-Lite    文件:MoveCraft_PlayerListener.java   
@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);
    }

}
项目:FlexMC    文件:PlayerManager.java   
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 );
    }

}
项目:PA    文件:PlayerEvents.java   
@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);
    }
}
项目:Ace    文件:PlayerListener.java   
@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();}

}
项目:gamecraft    文件:TestPlayerManager.java   
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;
}
项目:SamaGamesCore    文件:CooldownModule.java   
@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);
    }
}
项目:Karma    文件:JoinLeaveListeners.java   
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerJoin(PlayerJoinEvent e){
    if (!e.getPlayer().hasPlayedBefore()){
        karmaUserManager.addNewKarmaUser(e.getPlayer());
    } else {
        karmaUserManager.addKarmaUser(e.getPlayer());
    }
}
项目:HCFCore    文件:ScoreboardHandler.java   
@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);
}
项目:FastSpawn    文件:JoinQuitServer.java   
@EventHandler
   //Join
   public void onJoin(PlayerJoinEvent e) {
    Player player = e.getPlayer();
    if(Teams.getPlayerInWhereArea().containsKey(player)){
        Teams.QuitTeam(player);
    }
}
项目:HCFCore    文件:HungerFixListener.java   
@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;
/*    */   }
项目:CaveCloudAddon    文件:PlayerJoinListener.java   
@EventHandler
public void onJoin(PlayerJoinEvent e){
    /*
    CAVECLOUD API
     */
    CaveCloud.gameAPI
            .setPlayers(Bukkit.getOnlinePlayers().size())
            .update();
}
项目:GlowNPC    文件:GlowNPCPlugin.java   
@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);
}
项目:helper    文件:PacketScoreboard.java   
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);
    }
}
项目:HCFCore    文件:ScoreboardHandler.java   
@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);
}
项目:VoxelGamesLibv2    文件:GameListener.java   
@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);
}
项目:EscapeLag    文件:EmptyRestart.java   
@EventHandler(priority = EventPriority.LOWEST)
public void cancelRestart(PlayerJoinEvent evt){
    if(ConfigOptimize.emptyRestart) {
        Bukkit.getScheduler().cancelTask(restartTaskId);
        restartTaskId = -1;
    }
}
项目:ChatAssets    文件:LogHandler.java   
@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);
    }
}
项目:EscapeLag    文件:MonitorEnabler.java   
@EventHandler
public void JoinEnableMonitor(PlayerJoinEvent event){
    if(hasEnabled == false){
        if(ConfigFunction.Monitorenable){
            MonitorUtils.enable();
        }
        hasEnabled = true;
    }
}
项目:Minecordbot    文件:UserQuitJoinListener.java   
@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());
            }
        }
    }
}
项目:PetBlocks    文件:PetDataListener.java   
/**
 * 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);
            }
        }
    });
}
项目:Minecordbot    文件:UserQuitJoinListener.java   
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;
}
项目:Minecordbot    文件:SuperVanishListener.java   
@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);
    }
}
项目:OpenRPG    文件:TriggerJoinEvent.java   
@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());
}
项目:SamaGamesAPI    文件:SkyFactory.java   
@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));
}
项目:HCFCore    文件:ModeratorMode.java   
@EventHandler
public void onJoinMod(PlayerJoinEvent event) {
  Player player = event.getPlayer();
  if (player.hasPermission("rank.staff")) {
    enterMod(player);
  }
}
项目:ZorahPractice    文件:Kraken.java   
@EventHandler
public void onPlayerJoinEvent(PlayerJoinEvent event) {
    Player player = event.getPlayer();

    new BukkitRunnable() {
        @Override
        public void run() {
            checkPlayer(player);
        }
    }.runTaskLaterAsynchronously(PracticePlugin.getInstance(), 4L);
}
项目:MooProject    文件:ServerListener.java   
/**
 * 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));
}
项目:HeadGetter    文件:HeadListener.java   
@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!");
        }
    }

}
项目:MT_Core    文件:PlayerListener.java   
@EventHandler
private void onPlayerJoinEvent(PlayerJoinEvent e) {
    main.getPlayerManager().addMortuusPlayer(e.getPlayer());

    if (!main.getScoreboards().isHostile(e.getPlayer()))
        main.getScoreboards().addPlayer(e.getPlayer(), "NEUTRAL");
}
项目:LoggerAPI    文件:LoggerManager.java   
@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());
}
项目:ProjectAres    文件:PGMListener.java   
@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");
    }
}
项目:SamaGamesCore    文件:TabsColorsListener.java   
@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);
    });
}
项目:NeverLag    文件:ClientModDisabler.java   
@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));
        }
    }
}
项目:ProjectAres    文件:JoinMessageAnnouncer.java   
@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);
    }
}
项目:SurvivalPlus    文件:BedFatigue.java   
@SuppressWarnings("deprecation")
@EventHandler
public void onJoin(PlayerJoinEvent event)
{
    Player player = event.getPlayer();
    showAllSleeping(player);
    if(!player.hasPlayedBefore())
    {
        fatigue.getScore(player).setScore(0);
    }
}