Class KeyRegistry

java.lang.Object
org.cyclops.cyclopscore.client.key.KeyRegistry
All Implemented Interfaces:
IKeyRegistry, IRegistry

public class KeyRegistry extends Object implements IKeyRegistry
Enum that contains all custom hotkeys that are added. Every key also has a KeyMapping for that specific key.
  • Constructor Details

    • KeyRegistry

      public KeyRegistry()
  • Method Details

    • newKeyMapping

      public static net.minecraft.client.KeyMapping newKeyMapping(ModBase mod, String name, int defaultKey)
      Create a new keybinding.
      Parameters:
      mod - The mod.
      name - The unique name.
      defaultKey - The keycode.
      Returns:
      A new keybinding.
    • onPlayerKeyInput

      public void onPlayerKeyInput(net.minecraftforge.client.event.InputEvent.Key event)
      Description copied from interface: IKeyRegistry
      Handles key presses for keybindings added by EvilCraft Make sure to annotate this with SubscribeEvent
      Specified by:
      onPlayerKeyInput in interface IKeyRegistry
      Parameters:
      event - The input event.
    • addKeyHandler

      public void addKeyHandler(net.minecraft.client.KeyMapping kb, IKeyHandler handler)
      Description copied from interface: IKeyRegistry
      Binds a IKeyHandler to key presses of the specified KeyMapping. Whenever the KeyMapping is pressed, IKeyHandler.onKeyPressed(KeyMapping)} is called.
      Specified by:
      addKeyHandler in interface IKeyRegistry
      Parameters:
      kb - KeyMapping to which we bind the IKeyHandler.
      handler - IKeyHandler that will be linked to presses of the given KeyMapping.