Skip to content

Commit

Permalink
Update suppression fix
Browse files Browse the repository at this point in the history
  • Loading branch information
X-com committed Mar 23, 2020
1 parent 91c71f4 commit 23b95b8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
44 changes: 18 additions & 26 deletions patches/net/minecraft/server/MinecraftServer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -235,37 +235,29 @@
}

public void func_71190_q()
@@ -688,9 +768,12 @@
@@ -686,6 +766,10 @@
{
worldserver.func_72835_b();
}
+ catch (ThrowableSuppression e)
+ {
+ // Update Suppression crash fixes CARPET-XCOM
+ }
catch (Throwable throwable1)
{
- CrashReport crashreport = CrashReport.func_85055_a(throwable1, "Exception ticking world");
- worldserver.func_72914_a(crashreport);
- throw new ReportedException(crashreport);
+ // Update Suppression crash fixes CARPET-XCOM
+ if(!CarpetSettings.updateSuppressionCrashFix || !(throwable1.getCause() instanceof ThrowableSuppression)){
+ CrashReport crashreport = CrashReport.func_85055_a(throwable1, "Exception ticking world");
+ worldserver.func_72914_a(crashreport);
+ throw new ReportedException(crashreport);
+ }
CrashReport crashreport = CrashReport.func_85055_a(throwable1, "Exception ticking world");
@@ -697,6 +781,10 @@
{
worldserver.func_72939_s();
}

try
@@ -700,8 +783,11 @@
+ catch (ThrowableSuppression e)
+ {
+ // Update Suppression crash fixes CARPET-XCOM
+ }
catch (Throwable throwable)
{
CrashReport crashreport1 = CrashReport.func_85055_a(throwable, "Exception ticking world entities");
- worldserver.func_72914_a(crashreport1);
- throw new ReportedException(crashreport1);
+ // Update Suppression crash fixes CARPET-XCOM
+ if(!CarpetSettings.updateSuppressionCrashFix || !(crashreport1.func_71505_b() instanceof ThrowableSuppression)){
+ worldserver.func_72914_a(crashreport1);
+ throw new ReportedException(crashreport1);
+ }
}

this.field_71304_b.func_76319_b();
@@ -714,10 +800,12 @@
@@ -714,10 +802,12 @@
this.field_71312_k[j][this.field_71315_w % 100] = System.nanoTime() - i;
}

Expand All @@ -278,7 +270,7 @@
this.field_71304_b.func_76318_c("commandFunctions");
this.func_193030_aL().func_73660_a();
this.field_71304_b.func_76318_c("tickables");
@@ -728,6 +816,8 @@
@@ -728,6 +818,8 @@
}

this.field_71304_b.func_76319_b();
Expand All @@ -287,7 +279,7 @@
}

public boolean func_71255_r()
@@ -939,7 +1029,7 @@
@@ -939,7 +1031,7 @@

public String getServerModName()
{
Expand Down
6 changes: 5 additions & 1 deletion patches/net/minecraft/world/World.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@
}

public DifficultyInstance func_175649_E(BlockPos p_175649_1_)
@@ -3361,4 +3546,124 @@
@@ -3361,4 +3546,128 @@
{
return null;
}
Expand Down Expand Up @@ -550,6 +550,10 @@
+ {
+ iblockstate.func_189546_a(this, pos, blockIn, fromPos);
+ }
+ catch (ThrowableSuppression e)
+ {
+ throw new ThrowableSuppression("Update Suppression");
+ }
+ catch (StackOverflowError e)
+ {
+ throw new ThrowableSuppression("Update Suppression");
Expand Down

0 comments on commit 23b95b8

Please sign in to comment.