Coder Social home page Coder Social logo

Comments (7)

thecatcore avatar thecatcore commented on August 28, 2024

Upstream seemed to have a similar issue on this week snapshot which was because loader entrypoint was too late for this version. I’ll test if it got fixed at the same time and else I’ll open an issue in loader repo.

from fabric.

Nolij avatar Nolij commented on August 28, 2024

I've determined that this issue has 2 causes:

  1. In newer versions, the game options are loaded after mod initialization. In 7.10, the game options are loaded before mod initialization. Legacy Fabric Keybinding API injects the modded keybinds via a mixin for game options loading, introducing a race condition where mod keybinds haven't been registered yet when the API attempts to inject them. I've worked around this here: https://github.com/Nolij/Zume/blob/844e625eb94e55ade0828271ef3de0d4d3cd98a3/legacy/src/main/java/dev/nolij/zume/legacy/LegacyZume.java#L26-L31
  2. If keybinds are added for a non-existent category, no category is registered. I've worked around this here: https://github.com/Nolij/Zume/blob/master/legacy/src/main/java/dev/nolij/zume/legacy/mixin/KeyBindingMixin.java

With the two workarounds I linked, the issue doesn't occur (at least for my mod; other mods will still have problems). The second fix is necessary for all Legacy Fabric versions. The first one is only necessary for <=7.10.

from fabric.

tildejustin avatar tildejustin commented on August 28, 2024

I fixed this in speedrunigt by just initializing keys in GameOptions (RedLime/SpeedRunIGT#88)

from fabric.

Nolij avatar Nolij commented on August 28, 2024

I fixed this in speedrunigt by just initializing keys in GameOptions (RedLime/SpeedRunIGT#88)

Actually this is way better I'm going to do that instead.

from fabric.

thecatcore avatar thecatcore commented on August 28, 2024

Just realized I forgot to open the issue on loader repo.

from fabric.

Nolij avatar Nolij commented on August 28, 2024

Just realized I forgot to open the issue on loader repo.

Link?

from fabric.

thecatcore avatar thecatcore commented on August 28, 2024

We can probably add a KeybindingsRegistryEvent to help with it. You would have to subscribe to it from a ModInitializer instead of a ClientModInitializer tho.

from fabric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.