001 package org.bukkit.event.player; 002 003 import org.bukkit.entity.Player; 004 import org.bukkit.event.HandlerList; 005 006 /** 007 * Called when a player joins a server 008 */ 009 public class PlayerJoinEvent extends PlayerEvent { 010 private static final HandlerList handlers = new HandlerList(); 011 private String joinMessage; 012 013 public PlayerJoinEvent(final Player playerJoined, final String joinMessage) { 014 super(playerJoined); 015 this.joinMessage = joinMessage; 016 } 017 018 /** 019 * Gets the join message to send to all online players 020 * 021 * @return string join message 022 */ 023 public String getJoinMessage() { 024 return joinMessage; 025 } 026 027 /** 028 * Sets the join message to send to all online players 029 * 030 * @param joinMessage join message 031 */ 032 public void setJoinMessage(String joinMessage) { 033 this.joinMessage = joinMessage; 034 } 035 036 @Override 037 public HandlerList getHandlers() { 038 return handlers; 039 } 040 041 public static HandlerList getHandlerList() { 042 return handlers; 043 } 044 }