Added the SPAWN_CHANGE event, which occurs when a world's spawn is changed.

This event includes the world who's spawn changed and its previous spawn location.

To listen for this event:
  PluginManager pm = getServer().getPluginManager();
  YourWorldListener worldListener = new YourWorldListener(this);
  pm.registerEvent(Event.Type.SPAWN_CHANGE, worldListener, Priority.Normal, this);

To use this event:
  public class YourWorldListener extends WorldListener {
      @Override
      public void onSpawnChange(SpawnChangeEvent event) {
          World world = event.getWorld();
          Location previousLocation = event.getPreviousLocation();
      }
  }

By: William Bowers <william.bowers@gmail.com>
This commit is contained in:
Bukkit/Spigot
2011-03-29 01:59:00 -07:00
parent e7f980d6e9
commit 531a69463a
4 changed files with 49 additions and 0 deletions

View File

@@ -454,6 +454,13 @@ public abstract class Event implements Serializable {
*/
ITEM_SPAWN (Category.WORLD),
/**
* Called when a World's spawn is changed
*
* @see org.bukkit.event.world.SpawnChangeEvent
*/
SPAWN_CHANGE (Category.WORLD),
/**
* Called when a world is saved
*