From 79883453680df3aa99127d699d8771ee7140111c Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Wed, 9 Feb 2011 12:59:00 +0000 Subject: [PATCH] Added call to new event on world save (at stop and force save). (Per EyvindRM) --- .../java/net/minecraft/server/MinecraftServer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 23ef042b9e..e476b48ac6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -18,7 +18,9 @@ import joptsimple.OptionSet; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.scheduler.CraftScheduler; -// CraftBukkit end +import org.bukkit.event.Event; +import org.bukkit.event.world.WorldEvent; +//CraftBukkit end public class MinecraftServer implements ICommandListener, Runnable { @@ -173,6 +175,9 @@ public class MinecraftServer implements ICommandListener, Runnable { // Craftbukkit start for (WorldServer world : worlds) { world.a(true, (IProgressUpdate) null); + + Event worldSaved = new WorldEvent( Event.Type.WORLD_SAVED, world.getWorld() ); + server.getPluginManager().callEvent( worldSaved ); } // Craftbukkit end } @@ -351,6 +356,9 @@ public class MinecraftServer implements ICommandListener, Runnable { // Craftbukkit start for (WorldServer world : worlds) { world.a(true, (IProgressUpdate) null); + + Event worldSaved = new WorldEvent( Event.Type.WORLD_SAVED, world.getWorld() ); + server.getPluginManager().callEvent( worldSaved ); } this.f.d();