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

120 lines
3.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java
+++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java
@@ -1,5 +1,8 @@
package net.minecraft.server;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.relauncher.ArgsWrapper;
+import cpw.mods.fml.relauncher.FMLRelauncher;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.awt.GraphicsEnvironment;
@@ -351,7 +354,11 @@
{
if (this.func_71197_b())
{
+ FMLCommonHandler.instance().handleServerStarted();
+
long i = System.currentTimeMillis();
+
+ FMLCommonHandler.instance().onWorldLoadTick(field_71305_c);
for (long k0 = 0L; this.field_71317_u; this.field_71296_Q = true)
{
@@ -390,6 +397,7 @@
Thread.sleep(1L);
}
+ FMLCommonHandler.instance().handleServerStopping();
}
else
{
@@ -398,6 +406,10 @@
}
catch (Throwable throwable)
{
+ if (FMLCommonHandler.instance().shouldServerBeKilledQuietly())
+ {
+ return;
+ }
throwable.printStackTrace();
field_71306_a.log(Level.SEVERE, "Encountered an unexpected exception " + throwable.getClass().getSimpleName(), throwable);
CrashReport crashreport = null;
@@ -428,6 +440,10 @@
{
try
{
+ if (FMLCommonHandler.instance().shouldServerBeKilledQuietly())
+ {
+ return;
+ }
this.func_71260_j();
this.field_71316_v = true;
}
@@ -437,6 +453,7 @@
}
finally
{
+ FMLCommonHandler.instance().handleServerStopped();
this.func_71240_o();
}
}
@@ -453,8 +470,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)
@@ -500,6 +519,7 @@
this.field_71304_b.func_76319_b();
this.field_71304_b.func_76319_b();
+ FMLCommonHandler.instance().onPostServerTick();
}
public void func_71190_q()
@@ -527,6 +547,7 @@
}
this.field_71304_b.func_76320_a("tick");
+ FMLCommonHandler.instance().onPreWorldTick(worldserver);
CrashReport crashreport;
try
@@ -551,6 +572,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();
@@ -678,7 +700,7 @@
public String getServerModName()
{
- return "vanilla";
+ return "fml";
}
public CrashReport func_71230_b(CrashReport p_71230_1_)
@@ -1124,6 +1146,13 @@
@SideOnly(Side.SERVER)
public static void main(String[] p_main_0_)
{
+ FMLRelauncher.handleServerRelaunch(new ArgsWrapper(p_main_0_));
+ }
+
+ @SideOnly(Side.SERVER)
+ public static void fmlReentry(ArgsWrapper wrap)
+ {
+ String[] p_main_0_ = wrap.args;
StatList.func_75919_a();
try