Prevented Crash when the manual was open during a world crash or kick

This commit is contained in:
Ellpeck 2015-10-31 21:42:16 +01:00
parent 5e5173cf54
commit b24cd48984

View file

@ -54,8 +54,11 @@ public class PersistentClientData{
} }
private static String getName(){ private static String getName(){
if(Minecraft.getMinecraft().theWorld != null){
return Minecraft.getMinecraft().isIntegratedServerRunning() ? Minecraft.getMinecraft().getIntegratedServer().getFolderName() : Minecraft.getMinecraft().func_147104_D().serverIP; return Minecraft.getMinecraft().isIntegratedServerRunning() ? Minecraft.getMinecraft().getIntegratedServer().getFolderName() : Minecraft.getMinecraft().func_147104_D().serverIP;
} }
return "Invalid";
}
private static NBTTagCompound getCompoundForWorld(NBTTagCompound mainCompound){ private static NBTTagCompound getCompoundForWorld(NBTTagCompound mainCompound){
return mainCompound.getCompoundTag(getName()); return mainCompound.getCompoundTag(getName());