Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class KeyEventHandler implements IEventHandler {
- public static boolean isChalkGuiOpen = false;
- @SubscribeEvent
- public void keyEvent(InputEvent.KeyInputEvent keyInputEvent)
- {
- System.out.println("key event got");
- if (ModKeybind.keybindChalk.isPressed()&&!isChalkGuiOpen)
- {
- Minecraft.getMinecraft().displayGuiScreen(new GuiChalk());
- isChalkGuiOpen = true;
- }
- }
- @SubscribeEvent
- public void keyEvent(GuiScreenEvent.KeyboardInputEvent keyInputEvent)
- {
- boolean isPressed = ModKeybind.keybindChalk.isPressed();
- boolean isDown = ModKeybind.keybindChalk.isKeyDown();
- if(isChalkGuiOpen&&ModKeybind.keybindChalk.isPressed())
- {
- System.out.println("trying to close gui");
- Minecraft.getMinecraft().displayGuiScreen(null);
- isChalkGuiOpen = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement