mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Fix keybindings not loading properly from gamesettings file after restart
This commit is contained in:
1 parent
acb0b21d6d
commit
9dd9b6eb71
2 files changed
+30
No files matched your search
@@ -106,6 +106,8 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
|
||||
private MissingModsException modsMissing;
|
||||
|
||||
private boolean loading;
|
||||
|
||||
public void beginMinecraftLoading(Minecraft minecraft)
|
||||
{
|
||||
if (minecraft.func_71355_q())
|
||||
@@ -115,6 +117,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
return;
|
||||
}
|
||||
|
||||
loading = true;
|
||||
client = minecraft;
|
||||
ObfuscationReflectionHelper.detectObfuscation(World.class);
|
||||
TextureFXManager.instance().setClient(client);
|
||||
@@ -178,6 +181,7 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
LanguageRegistry.reloadLanguageTable();
|
||||
RenderingRegistry.instance().loadEntityRenderers((Map<Class<? extends Entity>, Render>)RenderManager.field_78727_a.field_78729_o);
|
||||
|
||||
loading = false;
|
||||
KeyBindingRegistry.instance().uploadKeyBindingsToGame(client.field_71474_y);
|
||||
}
|
||||
|
||||
@@ -380,4 +384,13 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
{
|
||||
client.func_71373_a(new GuiModsMissingForServer(modMissingPacket));
|
||||
}
|
||||
|
||||
/**
|
||||
* If the client is in the midst of loading, we disable saving so that custom settings aren't wiped out
|
||||
* @return
|
||||
*/
|
||||
public boolean isLoading()
|
||||
{
|
||||
return loading;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
--- ../src-base/minecraft/net/minecraft/src/GameSettings.java
|
||||
+++ ../src-work/minecraft/net/minecraft/src/GameSettings.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import java.io.BufferedReader;
|
||||
@@ -571,6 +572,7 @@
|
||||
|
||||
public void func_74303_b()
|
||||
{
|
||||
+ if (FMLClientHandler.instance().isLoading()) return;
|
||||
try
|
||||
{
|
||||
PrintWriter var1 = new PrintWriter(new FileWriter(this.field_74354_ai));
|
||||
Reference in new issue
Block a user