Move placement of single player world load hook to fix NPEs.
This commit is contained in:
parent
3b367fcb8e
commit
189dc35060
3 changed files with 11 additions and 32 deletions
|
@ -88,7 +88,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@@ -1978,6 +1991,8 @@
|
||||
@@ -1978,12 +1991,15 @@
|
||||
this.field_71453_ak.func_74428_b();
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,14 @@
|
|||
this.field_71424_I.func_76319_b();
|
||||
this.field_71423_H = func_71386_F();
|
||||
}
|
||||
@@ -2094,6 +2109,7 @@
|
||||
|
||||
public void func_71371_a(String p_71371_1_, String p_71371_2_, WorldSettings p_71371_3_)
|
||||
{
|
||||
+ FMLClientHandler.instance().startIntegratedServer(p_71371_1_, p_71371_2_, p_71371_3_);
|
||||
this.func_71403_a((WorldClient)null);
|
||||
System.gc();
|
||||
ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
|
||||
@@ -2094,6 +2110,7 @@
|
||||
this.field_110448_aq.func_148529_f();
|
||||
this.func_71351_a((ServerData)null);
|
||||
this.field_71455_al = false;
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.client.gui;
|
||||
|
||||
+import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.text.DateFormat;
|
||||
@@ -126,7 +127,7 @@
|
||||
}
|
||||
else if (p_146284_1_.field_146127_k == 1)
|
||||
{
|
||||
- this.func_146615_e(this.field_146640_r);
|
||||
+ FMLClientHandler.instance().tryLoadWorld(this,this.field_146640_r);
|
||||
}
|
||||
else if (p_146284_1_.field_146127_k == 3)
|
||||
{
|
||||
@@ -253,7 +254,7 @@
|
||||
|
||||
if (p_148144_2_ && flag1)
|
||||
{
|
||||
- GuiSelectWorld.this.func_146615_e(p_148144_1_);
|
||||
+ FMLClientHandler.instance().tryLoadWorld(GuiSelectWorld.this,p_148144_1_);
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,6 @@ import net.minecraft.client.gui.Gui;
|
|||
import net.minecraft.client.gui.GuiIngameMenu;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSelectWorld;
|
||||
import net.minecraft.client.gui.ServerListEntryNormal;
|
||||
import net.minecraft.client.multiplayer.GuiConnecting;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
|
@ -49,6 +48,7 @@ import net.minecraft.network.NetworkManager;
|
|||
import net.minecraft.network.ServerStatusResponse;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.base.Throwables;
|
||||
|
@ -554,10 +554,9 @@ public class FMLClientHandler implements IFMLSidedHandler
|
|||
}
|
||||
}
|
||||
|
||||
public void tryLoadWorld(GuiSelectWorld selectWorldGUI, int selectedIndex)
|
||||
public void startIntegratedServer(String id, String name, WorldSettings settings)
|
||||
{
|
||||
playClientBlock = new CountDownLatch(1);
|
||||
selectWorldGUI.func_146615_e(selectedIndex);
|
||||
}
|
||||
|
||||
public void showInGameModOptions(GuiIngameMenu guiIngameMenu)
|
||||
|
|
Loading…
Reference in a new issue