From 325f4e0c22228a61dfbf834261321f18c3b69859 Mon Sep 17 00:00:00 2001
From: William Bowers <william.bowers@gmail.com>
Date: Tue, 29 Mar 2011 02:04:42 -0700
Subject: [PATCH] Implemented the new SpawnChangeEvent in
 CraftWorld.setSpawnLocation()

---
 src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 10b126b00a..898ef3e0b0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -11,6 +11,7 @@ import java.util.Random;
 import net.minecraft.server.*;
 
 import org.bukkit.entity.Arrow;
+import org.bukkit.event.world.SpawnChangeEvent;
 import org.bukkit.block.Block;
 import org.bukkit.entity.Boat;
 import org.bukkit.Chunk;
@@ -72,7 +73,13 @@ public class CraftWorld implements World {
     
     public boolean setSpawnLocation(int x, int y, int z) {
         try {
+            Location previousLocation = getSpawnLocation();
             world.q.a(x, y, z);
+
+            // Notify anyone who's listening.
+            SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
+            server.getPluginManager().callEvent(event);
+
             return true;
         } catch (Exception e) {
             return false;