Skip to content

Commit

Permalink
Fixed vanilla issue where exceptions in World tasks would not be logged.
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Dec 1, 2014
1 parent 7cc7056 commit 9f4ef7b
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions patches/minecraft/net/minecraft/server/MinecraftServer.java.patch
Expand Up @@ -117,7 +117,21 @@
}

if (this.field_71307_n.func_76468_d())
@@ -681,15 +662,18 @@
@@ -671,25 +652,30 @@
{
try
{
- ((FutureTask)this.field_175589_i.poll()).run();
+ FutureTask task = (FutureTask)this.field_175589_i.poll();
+ task.run(); // Run the task
+ task.get(); // Poll the result, which throws an error if the task errored.
}
catch (Throwable throwable2)
{
- field_147145_h.fatal(throwable2);
+ field_147145_h.catching(org.apache.logging.log4j.Level.FATAL, throwable2); //Forge actually print the error correctly.
}
}
}

this.field_71304_b.func_76318_c("levels");
Expand All @@ -139,7 +153,7 @@
this.field_71304_b.func_76320_a(worldserver.func_72912_H().func_76065_j());

if (this.field_71315_w % 20 == 0)
@@ -733,9 +717,11 @@
@@ -733,9 +719,11 @@
this.field_71304_b.func_76319_b();
}

Expand All @@ -152,7 +166,7 @@
this.field_71304_b.func_76318_c("connection");
this.func_147137_ag().func_151269_c();
this.field_71304_b.func_76318_c("players");
@@ -774,7 +760,13 @@
@@ -774,7 +762,13 @@

public WorldServer func_71218_a(int p_71218_1_)
{
Expand All @@ -167,15 +181,15 @@
}

public String func_71249_w()
@@ -1025,6 +1017,7 @@
@@ -1025,6 +1019,7 @@

if (worldserver != null)
{
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(worldserver));
worldserver.func_73041_k();
}
}
@@ -1607,7 +1600,6 @@
@@ -1607,7 +1602,6 @@
this.field_71319_s = p_71208_1_;
}

Expand Down

0 comments on commit 9f4ef7b

Please sign in to comment.