geforkt von Mirrors/Paper
Added PlayerChangedWorldEvent.
By: sunkid <sunkid@iminurnetz.com>
Dieser Commit ist enthalten in:
Ursprung
2ef3dfed7b
Commit
2a3a80d543
@ -312,6 +312,13 @@ public abstract class Event implements Serializable {
|
||||
*/
|
||||
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
|
||||
*/
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -205,4 +205,11 @@ public class PlayerListener implements Listener {
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onPlayerGameModeChange(PlayerGameModeChangeEvent event) {}
|
||||
|
||||
/**
|
||||
* Called after a player changes to a new world
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {}
|
||||
}
|
||||
|
@ -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
|
||||
case BLOCK_PHYSICS:
|
||||
return new EventExecutor() {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren