Fix WorldEvent.Unload not firing on the client (fixes #5880) (#5884)

This commit is contained in:
Take Weiland 2019-07-02 21:58:45 +02:00 committed by LexManos
parent 0574db134c
commit 478b7e7ccc

View file

@ -206,7 +206,15 @@
WorkingScreen workingscreen = new WorkingScreen(); WorkingScreen workingscreen = new WorkingScreen();
workingscreen.func_200210_a(new TranslationTextComponent("connect.joining")); workingscreen.func_200210_a(new TranslationTextComponent("connect.joining"));
this.func_213241_c(workingscreen); this.func_213241_c(workingscreen);
@@ -1623,6 +1651,7 @@ @@ -1586,6 +1614,7 @@
NarratorChatListener.field_193643_a.func_193642_b();
this.func_213241_c(p_213231_1_);
if (this.field_71441_e != null) {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
if (integratedserver != null) {
while(!integratedserver.func_213201_w()) {
this.func_195542_b(false);
@@ -1623,6 +1652,7 @@
} }
TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_); TileEntityRendererDispatcher.field_147556_a.func_147543_a(p_213257_1_);
@ -214,7 +222,7 @@
} }
public final boolean func_71355_q() { public final boolean func_71355_q() {
@@ -1648,112 +1677,8 @@ @@ -1648,112 +1678,8 @@
private void func_147112_ai() { private void func_147112_ai() {
if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) { if (this.field_71476_x != null && this.field_71476_x.func_216346_c() != RayTraceResult.Type.MISS) {
@ -329,7 +337,7 @@
} }
} }
@@ -1825,6 +1750,7 @@ @@ -1825,6 +1751,7 @@
return field_71432_P; return field_71432_P;
} }
@ -337,7 +345,7 @@
public CompletableFuture<Void> func_213245_w() { public CompletableFuture<Void> func_213245_w() {
return this.func_213169_a(this::func_213237_g).thenCompose((p_213240_0_) -> { return this.func_213169_a(this::func_213237_g).thenCompose((p_213240_0_) -> {
return p_213240_0_; return p_213240_0_;
@@ -1968,6 +1894,8 @@ @@ -1968,6 +1895,8 @@
} }
public MusicTicker.MusicType func_147109_W() { public MusicTicker.MusicType func_147109_W() {
@ -346,7 +354,7 @@
if (this.field_71462_r instanceof WinGameScreen) { if (this.field_71462_r instanceof WinGameScreen) {
return MusicTicker.MusicType.CREDITS; return MusicTicker.MusicType.CREDITS;
} else if (this.field_71439_g == null) { } else if (this.field_71439_g == null) {
@@ -2124,4 +2052,12 @@ @@ -2124,4 +2053,12 @@
public LoadingGui func_213250_au() { public LoadingGui func_213250_au() {
return this.field_213279_p; return this.field_213279_p;
} }