Skip to content
This repository has been archived by the owner on May 26, 2018. It is now read-only.

Key-bindings are not loaded at all #264

Closed
Lunatrius opened this issue Jul 19, 2013 · 8 comments
Closed

Key-bindings are not loaded at all #264

Lunatrius opened this issue Jul 19, 2013 · 8 comments

Comments

@Lunatrius
Copy link

Key-bindings aren't being loaded at all. The config file gets written to in multiple places before FML adds key bindings:

java.lang.Exception: save
    at net.minecraft.client.settings.GameSettings.saveOptions(GameSettings.java:788)
    at net.minecraft.client.audio.SoundManager.tryToSetLibraryAndCodecs(SoundManager.java:155)
    at net.minecraft.client.audio.SoundManager.func_110549_a(SoundManager.java:99)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:109)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:466)
java.lang.Exception: save
    at net.minecraft.client.settings.GameSettings.saveOptions(GameSettings.java:788)
    at net.minecraft.client.audio.SoundManager.tryToSetLibraryAndCodecs(SoundManager.java:171)
    at net.minecraft.client.audio.SoundManager.func_110549_a(SoundManager.java:99)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:109)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:466)
java.lang.Exception: save
    at net.minecraft.client.settings.GameSettings.saveOptions(GameSettings.java:788)
    at net.minecraft.client.audio.SoundManager.tryToSetLibraryAndCodecs(SoundManager.java:155)
    at net.minecraft.client.audio.SoundManager.func_110549_a(SoundManager.java:99)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110544_b(SimpleReloadableResourceManager.java:119)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110541_a(SimpleReloadableResourceManager.java:103)
    at net.minecraft.client.Minecraft.func_110436_a(Minecraft.java:540)
    at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:236)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:506)
java.lang.Exception: save
    at net.minecraft.client.settings.GameSettings.saveOptions(GameSettings.java:788)
    at net.minecraft.client.audio.SoundManager.tryToSetLibraryAndCodecs(SoundManager.java:171)
    at net.minecraft.client.audio.SoundManager.func_110549_a(SoundManager.java:99)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110544_b(SimpleReloadableResourceManager.java:119)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110541_a(SimpleReloadableResourceManager.java:103)
    at net.minecraft.client.Minecraft.func_110436_a(Minecraft.java:540)
    at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:236)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:506)

While FML tries to load key bindings here:

java.lang.Exception: load
    at net.minecraft.client.settings.GameSettings.loadOptions(GameSettings.java:513)
    at cpw.mods.fml.client.registry.KeyBindingRegistry.uploadKeyBindingsToGame(KeyBindingRegistry.java:197)
    at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:240)
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:506)
@cpw
Copy link
Contributor

cpw commented Jul 27, 2013

OK, will fix..

@Lunatrius
Copy link
Author

I've already thought about submitting a PR, but seeing that that method is deprecated I didn't really know what to do. Also just calling the method before the other things didn't seem the right thing to do considering the method name (unless I ripped it out and made it a separate method).

@cpw
Copy link
Contributor

cpw commented Jul 27, 2013

Nope, I just checked, my keybinding protection code is still in place. Keybinding should be working fine.

@Lunatrius
Copy link
Author

It is in place, it's just called too late. FML loads them at Minecraft.java:506 and they're first saved in Minecraft.java:466.

@cpw
Copy link
Contributor

cpw commented Jul 28, 2013

No, the save should be disabled prior to FML loading. Check the isloading value..

@Lunatrius
Copy link
Author

https://gist.github.com/Lunatrius/dcbc3c2a2ef1e466f021

You're calling beginMinecraftLoading on line 470, however saveSettings is being called twice on line 466 via this.field_110451_am.func_110542_a(this.sndManager);. The loading variable is set too late to actually be of any use.

        this.field_110451_am.func_110542_a(this.sndManager); // settings are saved twice here
        this.loadScreen();
        this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false);

        FMLClientHandler.instance().beginMinecraftLoading(this, this.field_110449_ao); // loading is set to true here

@cpw
Copy link
Contributor

cpw commented Jul 28, 2013

Cool thanks for that. I'll default it to true, that'll fix it :-)

@cpw
Copy link
Contributor

cpw commented Aug 11, 2013

Fixed some time ago : 57befa8

@cpw cpw closed this as completed Aug 11, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants