Files
MinecraftForge/patches/minecraft/net/minecraft/server/MinecraftServer.java.patch
T

105 lines
3.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java
+++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java
@@ -1,5 +1,6 @@
package net.minecraft.server;
+import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.awt.GraphicsEnvironment;
@@ -368,7 +369,11 @@
{
if (this.func_71197_b())
{
+ FMLCommonHandler.instance().handleServerStarted();
+
long i = func_130071_aq();
+
+ FMLCommonHandler.instance().onWorldLoadTick(field_71305_c);
for (long j = 0L; this.field_71317_u; this.field_71296_Q = true)
{
@@ -407,6 +412,7 @@
Thread.sleep(1L);
}
+ FMLCommonHandler.instance().handleServerStopping();
}
else
{
@@ -415,6 +421,10 @@
}
catch (Throwable throwable)
{
+ if (FMLCommonHandler.instance().shouldServerBeKilledQuietly())
+ {
+ return;
+ }
throwable.printStackTrace();
this.func_98033_al().func_98234_c("Encountered an unexpected exception " + throwable.getClass().getSimpleName(), throwable);
CrashReport crashreport = null;
@@ -445,6 +455,10 @@
{
try
{
+ if (FMLCommonHandler.instance().shouldServerBeKilledQuietly())
+ {
+ return;
+ }
this.func_71260_j();
this.field_71316_v = true;
}
@@ -454,6 +468,8 @@
}
finally
{
+ FMLCommonHandler.instance().handleServerStopped();
+ this.field_71316_v = true;
this.func_71240_o();
}
}
@@ -470,8 +486,10 @@
public void func_71217_p()
{
+ FMLCommonHandler.instance().rescheduleTicks(Side.SERVER);
long i = System.nanoTime();
AxisAlignedBB.func_72332_a().func_72298_a();
+ FMLCommonHandler.instance().onPreServerTick();
++this.field_71315_w;
if (this.field_71295_T)
@@ -517,6 +535,7 @@
this.field_71304_b.func_76319_b();
this.field_71304_b.func_76319_b();
+ FMLCommonHandler.instance().onPostServerTick();
}
public void func_71190_q()
@@ -544,6 +563,7 @@
}
this.field_71304_b.func_76320_a("tick");
+ FMLCommonHandler.instance().onPreWorldTick(worldserver);
CrashReport crashreport;
try
@@ -568,6 +588,7 @@
throw new ReportedException(crashreport);
}
+ 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();
@@ -695,7 +716,7 @@
public String getServerModName()
{
- return "vanilla";
+ return FMLCommonHandler.instance().getModName();
}
public CrashReport func_71230_b(CrashReport p_71230_1_)