Jump to content

BatHeart

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by BatHeart

  1. This might not be applicable to your situation, then, but since my crash is caused by binding keys to an undefined category, I just assigned them to a category which is defined, but is not currently used for anything: "key.categories.ui".
  2. Thanks, Alpvax. I was well aware that it's very early days for the 1.12 builds. I don't think this is a bug in Forge, and that's certainly not why I posted. I noticed that work had been going on in the Mojang code in this area which has affected the way we have to do things, and thought I'd bring that to people's attention, along with asking if anyone had any suggestions. I actually have a workaround which is fine. Better will be some adaptation that allows everyone to specify their own 'keybinding categories' - but I didn't think it was the kind of thing anyone would look into unless someone mentioned the change that had occurred. That's all.
  3. I have defined several keys for use by a mod, by defining each as a KeyBinding, and registering each by ClientRegistry.registerKeyBinding(). This has been working OK up to 1.11.2, but has hit a problem when I updated to 1.12. Minecraft crashes when entering Options => Controls, and I can see why: I have provided a custom category for all of the bound keys, so that they will all appear grouped under a heading for my mod in the Options => Controls screen. What has happened in 1.12 is that several changes have been made to the net.minecraft.client.settings.KeyBinding.class. There is a private static final Map attribute called field_193627_d and this is filled with a set of key category descriptions, each mapped to an integer. E.g. field_193627_d.put("key.categories.inventory", Integer.valueOf(3)); Of course, my custom key category doesn't appear here, and there doesn't seem to be a way I can add it. This wouldn't be a problem, except there is now a compareTo() method on KeyBinding, which is called (indirectly) from net.minecraft.client.gui.GuiKeyBindingList - and this fails with a NullPointerException because my custom category is unrecognised. I have worked around this, by assigning my key bindings to one of the existing categories, but this isn't ideal, as I would like to be able to group my mod's keys together like I did previously, and of course anybody else who writes a mod that binds keys will probably have to put theirs into the same group, which begins to get messy. I wonder whether anyone has any suggestions as to how to improve the key binding mechanism in 1.12?
  4. All of this discussion is now superseded. Version 2322 is out now, and specifically mentions fixing this problem in the changelog. I have run it and it does indeed work. This thread can now be closed.
  5. Absolutely! Thank you. I didn't think it was going to be that simple. I imagined this was the first of many files that could not be downloaded, but you are quite correct, and now I have it running.
  6. Please note that it still won't run, as I noted in a separate thread. Lex Manos said it was a dev build, and not to use it. (Wait for a later build that does run, I assume)
  7. That's cool. I appreciate it, and will wait until a dev release that mentions this in the changelog before trying again.
  8. I understand that this is a dev version. Just wanted to let you know. I installed 2321 successfully (had to uncheck the Mercurius option first) When I try to launch, it fails to download file asm-all-5.1.jar I see this message in the launcher: Couldn't get hash for org/ow2/asm/asm-all/5.1/asm-all-5.1.jar from https://libraries.minecraft.net/org/ow2/asm/asm-all/5.1/asm-all-5.1.jar.sha1: HTTP 404: Not Found I have tried this in the Mojang launcher, and also in MultiMC.
  9. Thank you so much, Skerp! I was doing all of the registration already. That was fine. But you've shown me the method to detect the key-presses and that works perfectly I'll be able to put my mods up very soon - probably today. Brilliant news, and thank you again
  10. My apologies if I am missing something very obvious. It may be that this area has not yet been fully coded for the 1.7.2 forge, in which case I understand. I am trying to update a couple of mods which I had working in 1.6. They used a keyhandler so that I could detect various function key presses to make things appear and disappear on-screen. I realise that the keyhandler has been entirely replaced by an event-driven approach in 1.7. I believe we now have InputEvent which implements Event, and KeyInputEvent and MouseInputEvent which implement InputEvent. I can see that KeyInputEvent does indeed fire when a key is pressed, as expected. However, I am lost when trying to discover which key has been pressed! There is no code within KeyInputEvent, so I have no public getter methods or public variables that I can access. As I said, maybe I am simply trying to use something that hasn't yet been implemented, in which case I apologise for wasting anyone's time.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.