--- a/net/minecraft/client/GameSettings.java
+++ b/net/minecraft/client/GameSettings.java
@@ -170,6 +170,7 @@
    public boolean field_241568_aS_;
 
    public GameSettings(Minecraft p_i46326_1_, File p_i46326_2_) {
+      setForgeKeybindProperties();
       this.field_74317_L = p_i46326_1_;
       this.field_74354_ai = new File(p_i46326_2_, "options.txt");
       if (p_i46326_1_.func_147111_S() && Runtime.getRuntime().maxMemory() >= 1000000000L) {
@@ -529,7 +530,11 @@
 
                for(KeyBinding keybinding : this.field_74324_K) {
                   if (s.equals("key_" + keybinding.func_151464_g())) {
-                     keybinding.func_197979_b(InputMappings.func_197955_a(s1));
+                     if (s1.indexOf(':') != -1) {
+                        String[] pts = s1.split(":");
+                        keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.valueFromString(pts[1]), InputMappings.func_197955_a(pts[0]));
+                     } else
+                        keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, InputMappings.func_197955_a(s1));
                   }
                }
 
@@ -576,6 +581,7 @@
    }
 
    public void func_74303_b() {
+      if (net.minecraftforge.fml.client.ClientModLoader.isLoading()) return; //Don't save settings before mods add keybindigns and the like to prevent them from being deleted.
       try (PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(this.field_74354_ai), StandardCharsets.UTF_8))) {
          printwriter.println("version:" + SharedConstants.func_215069_a().getWorldVersion());
          printwriter.println("autoJump:" + AbstractOption.field_216719_z.func_216741_b(this));
@@ -661,7 +667,7 @@
          printwriter.println("syncChunkWrites:" + this.field_241568_aS_);
 
          for(KeyBinding keybinding : this.field_74324_K) {
-            printwriter.println("key_" + keybinding.func_151464_g() + ":" + keybinding.func_197982_m());
+            printwriter.println("key_" + keybinding.func_151464_g() + ":" + keybinding.func_197982_m() + (keybinding.getKeyModifier() != net.minecraftforge.client.settings.KeyModifier.NONE ? ":" + keybinding.getKeyModifier() : ""));
          }
 
          for(SoundCategory soundcategory : SoundCategory.values()) {
@@ -760,6 +766,23 @@
       p_198017_1_.func_198985_a(set);
    }
 
+   private void setForgeKeybindProperties() {
+      net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME;
+      field_74351_w.setKeyConflictContext(inGame);
+      field_74370_x.setKeyConflictContext(inGame);
+      field_74368_y.setKeyConflictContext(inGame);
+      field_74366_z.setKeyConflictContext(inGame);
+      field_74314_A.setKeyConflictContext(inGame);
+      field_228046_af_.setKeyConflictContext(inGame);
+      field_151444_V.setKeyConflictContext(inGame);
+      field_74312_F.setKeyConflictContext(inGame);
+      field_74310_D.setKeyConflictContext(inGame);
+      field_74321_H.setKeyConflictContext(inGame);
+      field_74323_J.setKeyConflictContext(inGame);
+      field_151457_aa.setKeyConflictContext(inGame);
+      field_151458_ab.setKeyConflictContext(inGame);
+   }
+
    public PointOfView func_243230_g() {
       return this.field_243228_bb;
    }
