mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 23:01:01 +01:00
Added player join event
By: Raphfrk <raphfrk@gmail.com>
This commit is contained in:
parent
0196ba1320
commit
0bde75cc9d
3 changed files with 32 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ public class PlayerListener implements Listener {
|
|||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onPlayerJoin(PlayerEvent event) {
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue