Class AddKeybindPacket
java.lang.Object
dev.munebase.dynamickeybinds.network.AddKeybindPacket
Network packet sent from client to server to request adding a new keybind.
This packet allows clients to register new dynamic keybinds on the server side,
which are then persisted and synchronized to all players. It carries the
keybind ID, key code, and category information.
Direction: Client -> Server
Handler: Server-side keybind handler (ForgeServerKeybindHandler or FabricServerKeybindHandler)
-
Constructor Summary
ConstructorsConstructorDescriptionAddKeybindPacket(String id, int keyCode, String category) Construct a new AddKeybindPacket.AddKeybindPacket(String id, int keyCode, String category, Optional<DynamicKeybindAction> action) Construct a new AddKeybindPacket with an optional action. -
Method Summary
Modifier and TypeMethodDescriptionGet the optional action payload.Get the keybind category.getId()Get the keybind ID.intGet the key code.
-
Constructor Details
-
AddKeybindPacket
Construct a new AddKeybindPacket.- Parameters:
id- unique keybind identifierkeyCode- the GLFW key codecategory- the keybind category
-
AddKeybindPacket
public AddKeybindPacket(String id, int keyCode, String category, Optional<DynamicKeybindAction> action) Construct a new AddKeybindPacket with an optional action.- Parameters:
id- unique keybind identifierkeyCode- the GLFW key codecategory- the keybind categoryaction- optional action payload
-
-
Method Details
-
getId
Get the keybind ID.- Returns:
- the unique identifier
-
getKeyCode
public int getKeyCode()Get the key code.- Returns:
- the GLFW key code
-
getCategory
Get the keybind category.- Returns:
- the category string
-
getAction
Get the optional action payload.- Returns:
- optional action
-