-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synced Keybinds API #104
Synced Keybinds API #104
Conversation
How will this interact with https://github.com/Nova-Committee/ModernKeyBinding/tree/Forge/1.7.10 ? |
Because you are calling, keybind.isKeyPressed, it should be fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we would need to register a listener for every player per keybind?
I can think of loads of keybinds that only exist to send a packet to the server so it would be nice to have the option of always doing an action server-side when a player presses the keybind.
(registering a Consumer that gets called when it's pressed maybe?) Scratch that, just a global listener with the existing interface would be great
Originally when I wrote this code (quite some time ago for another project), it was written primarily for armor keybinds, so the armor item could subscribe for a player in that case. I think there's merit to both ways of listening though, so I'll look into supporting either way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works well, great work!
Creates a new API for syncing player client key presses to the server for specified keys.
Supports two different types of key checks:
Supports lightweight keybinds for a
Keyboard
key code, wrapped MCKeyBinding
types with server syncing, and brand newKeyBinding
binds with configuration available on the controls page like normal