diff options
Diffstat (limited to 'src/main')
3 files changed, 32 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java new file mode 100644 index 00000000..80e9912c --- /dev/null +++ b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java @@ -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; + } +} diff --git a/src/main/java/org/bukkit/event/player/PlayerListener.java b/src/main/java/org/bukkit/event/player/PlayerListener.java index 0c817c1d..798aa216 100644 --- a/src/main/java/org/bukkit/event/player/PlayerListener.java +++ b/src/main/java/org/bukkit/event/player/PlayerListener.java @@ -15,7 +15,7 @@ public class PlayerListener implements Listener { * * @param event Relevant event details */ - public void onPlayerJoin(PlayerEvent event) { + public void onPlayerJoin(PlayerJoinEvent event) { } /** diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index e69a4c47..06cf836c 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -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: |