Implemented KeyPressed event.

This commit is contained in:
luisc committed 2021-10-11 07:16:10 -05:00
1 parent 1ee14920ff
commit 6c8c7671b8
7 files changed
+57 -18

No files matched your search

+1 -1
View File
@@ -149,7 +149,7 @@ public class EventHooks {
public static void onPlayerKeyPressed(EntityPlayerMP player, int button, boolean isCtrlPressed, boolean isShiftPressed, boolean isAltPressed, boolean isMetaPressed) {
PlayerDataScript handler = PlayerData.get(player).scriptData;
KeyPressedEvent event = new KeyPressedEvent(handler.getPlayer(), button, isCtrlPressed, isAltPressed, isShiftPressed, isMetaPressed);
handler.callScript(EnumScriptType.KEY_PRESSED, event);
handler.callScript(EnumScriptType.KEY_PRESSED, event, "key", button, "isCtrlPressed", isCtrlPressed, "isAltPressed", isAltPressed, "isShiftPressed", isShiftPressed, "isMetaPressed", isMetaPressed);
WrapperNpcAPI.EVENT_BUS.post(event);
}