001 package org.bukkit.event.player;
002
003 import org.bukkit.World;
004 import org.bukkit.entity.Player;
005 import org.bukkit.event.HandlerList;
006
007 /**
008 * Called when a player switches to another world.
009 */
010 public class PlayerChangedWorldEvent extends PlayerEvent {
011 private static final HandlerList handlers = new HandlerList();
012 private final World from;
013
014 public PlayerChangedWorldEvent(final Player player, final World from) {
015 super(player);
016 this.from = from;
017 }
018
019 /**
020 * Gets the world the player is switching from.
021 *
022 * @return player's previous world
023 */
024 public World getFrom() {
025 return from;
026 }
027
028 @Override
029 public HandlerList getHandlers() {
030 return handlers;
031 }
032
033 public static HandlerList getHandlerList() {
034 return handlers;
035 }
036 }