Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onLogin(PlayerLoginEvent e) {}
- @EventHandler
- public void onJoin(PlayerJoinEvent e)
- {
- McRPG.addPlayer(e.getPlayer());
- e.getPlayer().getInventory().setItem(8, Items.pointsItem());
- if (!e.getPlayer().hasPlayedBefore()) {
- e.setJoinMessage(ChatColor.GOLD + "Przywitajmy nowego gracza " + ChatColor.BOLD + e.getPlayer().getDisplayName());
- } else {
- e.setJoinMessage(null);
- }
- String old = e.getPlayer().getName();
- EntityPlayer p = ((CraftPlayer)e.getPlayer()).getHandle();
- p.displayName = (old + " [" + ChatColor.GREEN + ChatColor.BOLD + e.getPlayer().getLevel() + ChatColor.WHITE + "]");
- for (Player p1 : Bukkit.getOnlinePlayers()) {
- if (p1 != e.getPlayer()) {
- ((CraftPlayer)p1).getHandle().playerConnection.sendPacket(new PacketPlayOutNamedEntitySpawn(p));
- }
- }
- e.getPlayer().setCustomName(old + " [" + ChatColor.GREEN + ChatColor.BOLD + e.getPlayer().getLevel() + ChatColor.WHITE + "]");
- e.getPlayer().setCustomNameVisible(false);
- e.getPlayer().setCustomNameVisible(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement