001 package org.bukkit.event.world; 002 003 import org.bukkit.World; 004 import org.bukkit.Location; 005 import org.bukkit.event.HandlerList; 006 007 /** 008 * An event that is called when a world's spawn changes. The world's previous 009 * spawn location is included. 010 */ 011 public class SpawnChangeEvent extends WorldEvent { 012 private static final HandlerList handlers = new HandlerList(); 013 private final Location previousLocation; 014 015 public SpawnChangeEvent(final World world, final Location previousLocation) { 016 super(world); 017 this.previousLocation = previousLocation; 018 } 019 020 /** 021 * Gets the previous spawn location 022 * 023 * @return Location that used to be spawn 024 */ 025 public Location getPreviousLocation() { 026 return previousLocation; 027 } 028 029 @Override 030 public HandlerList getHandlers() { 031 return handlers; 032 } 033 034 public static HandlerList getHandlerList() { 035 return handlers; 036 } 037 }