--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java
+++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java
@@ -399,7 +399,7 @@
 
     public void func_71260_j()
     {
-        if (!this.field_71290_O)
+        if (!this.field_71290_O && net.minecraftforge.fml.common.Loader.instance().hasReachedState(net.minecraftforge.fml.common.LoaderState.SERVER_STARTED) && !field_71316_v) // make sure the save is valid and we don't save twice
         {
             field_147145_h.info("Stopping server");
 
@@ -456,6 +456,7 @@
         {
             if (this.func_71197_b())
             {
+                net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarted();
                 this.field_175591_ab = func_130071_aq();
                 long i = 0L;
                 this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C));
@@ -500,12 +501,20 @@
                     Thread.sleep(Math.max(1L, 50L - i));
                     this.field_71296_Q = true;
                 }
+                net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStopping();
+                net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions
             }
             else
             {
+                net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions
                 this.func_71228_a((CrashReport)null);
             }
         }
+        catch (net.minecraftforge.fml.common.StartupQuery.AbortedException e)
+        {
+            // ignore silently
+            net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions
+        }
         catch (Throwable throwable1)
         {
             field_147145_h.error("Encountered an unexpected exception", throwable1);
@@ -531,6 +540,7 @@
                 field_147145_h.error("We were unable to save this crash report to disk.");
             }
 
+            net.minecraftforge.fml.common.FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions
             this.func_71228_a(crashreport);
         }
         finally
@@ -546,6 +556,8 @@
             }
             finally
             {
+                net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStopped();
+                this.field_71316_v = true;
                 this.func_71240_o();
             }
         }
@@ -591,6 +603,7 @@
     public void func_71217_p()
     {
         long i = System.nanoTime();
+        net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreServerTick();
         ++this.field_71315_w;
 
         if (this.field_71295_T)
@@ -644,6 +657,7 @@
 
         this.field_71304_b.func_76319_b();
         this.field_71304_b.func_76319_b();
+        net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostServerTick();
     }
 
     public void func_71190_q()
@@ -686,6 +700,7 @@
                 }
 
                 this.field_71304_b.func_76320_a("tick");
+                net.minecraftforge.fml.common.FMLCommonHandler.instance().onPreWorldTick(worldserver);
                 CrashReport crashreport;
 
                 try
@@ -710,6 +725,7 @@
                     throw new ReportedException(crashreport);
                 }
 
+                net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostWorldTick(worldserver);
                 this.field_71304_b.func_76319_b();
                 this.field_71304_b.func_76320_a("tracker");
                 worldserver.func_73039_n().func_72788_a();
@@ -741,6 +757,7 @@
 
     public void func_71256_s()
     {
+        net.minecraftforge.fml.common.StartupQuery.reset();
         this.field_175590_aa = new Thread(this, "Server thread");
         this.field_175590_aa.start();
     }
@@ -787,7 +804,7 @@
 
     public String getServerModName()
     {
-        return "vanilla";
+        return net.minecraftforge.fml.common.FMLCommonHandler.instance().getModName();
     }
 
     public CrashReport func_71230_b(CrashReport p_71230_1_)
