Added player join event

By: Raphfrk <raphfrk@gmail.com>
This commit is contained in:
Bukkit/Spigot 2011-03-26 11:29:48 +00:00
parent 0196ba1320
commit 0bde75cc9d
3 changed files with 32 additions and 2 deletions

View file

@ -0,0 +1,30 @@
package org.bukkit.event.player;
import org.bukkit.entity.Player;
public class PlayerJoinEvent extends PlayerEvent {
private String joinMessage;
public PlayerJoinEvent(Type eventType, Player playerJoined, String joinMessage) {
super(eventType, playerJoined);
this.joinMessage = joinMessage;
}
/**
* Gets the join message to send to all online players
*
* @return string join message
*/
public String getJoinMessage() {
return joinMessage;
}
/**
* Sets the join message to send to all online players
*
* @param joinMessage join message
*/
public void setJoinMessage(String joinMessage) {
this.joinMessage = joinMessage;
}
}

View file

@ -15,7 +15,7 @@ public class PlayerListener implements Listener {
*
* @param event Relevant event details
*/
public void onPlayerJoin(PlayerEvent event) {
public void onPlayerJoin(PlayerJoinEvent event) {
}
/**

View file

@ -168,7 +168,7 @@ public final class JavaPluginLoader implements PluginLoader {
case PLAYER_JOIN:
return new EventExecutor() {
public void execute( Listener listener, Event event ) {
((PlayerListener)listener).onPlayerJoin( (PlayerEvent)event );
((PlayerListener)listener).onPlayerJoin( (PlayerJoinEvent)event );
}
};
case PLAYER_QUIT: