13
0
geforkt von Mirrors/Paper

Added PlayerChangedWorldEvent.

By: sunkid <sunkid@iminurnetz.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-09-30 20:29:24 +02:00
Ursprung 2ef3dfed7b
Commit 2a3a80d543
4 geänderte Dateien mit 39 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -312,6 +312,13 @@ public abstract class Event implements Serializable {
*/ */
PLAYER_GAME_MODE_CHANGE(Category.PLAYER), PLAYER_GAME_MODE_CHANGE(Category.PLAYER),
/**
* Called after a player has changed to a new world
*
* @see org.bukkit.event.player.PlayerChangedWorldEvent
*/
PLAYER_CHANGED_WORLD(Category.PLAYER),
/** /**
* BLOCK EVENTS * BLOCK EVENTS
*/ */

Datei anzeigen

@ -0,0 +1,18 @@
package org.bukkit.event.player;
import org.bukkit.World;
import org.bukkit.entity.Player;
public class PlayerChangedWorldEvent extends PlayerEvent {
private final World from;
public PlayerChangedWorldEvent(Player player, World from) {
super(Type.PLAYER_CHANGED_WORLD, player);
this.from = from;
}
public World getFrom() {
return from;
}
}

Datei anzeigen

@ -205,4 +205,11 @@ public class PlayerListener implements Listener {
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onPlayerGameModeChange(PlayerGameModeChangeEvent event) {} public void onPlayerGameModeChange(PlayerGameModeChangeEvent event) {}
/**
* Called after a player changes to a new world
*
* @param event Relevant event details
*/
public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {}
} }

Datei anzeigen

@ -434,6 +434,13 @@ public class JavaPluginLoader implements PluginLoader {
} }
}; };
case PLAYER_CHANGED_WORLD:
return new EventExecutor() {
public void execute(Listener listener, Event event) {
((PlayerListener) listener).onPlayerChangedWorld((PlayerChangedWorldEvent) event);
}
};
// Block Events // Block Events
case BLOCK_PHYSICS: case BLOCK_PHYSICS:
return new EventExecutor() { return new EventExecutor() {