net.minecraft.client.gui.screen.ChatScreen Java Examples
The following examples show how to use
net.minecraft.client.gui.screen.ChatScreen.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixinKeyboard.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "net/minecraft/client/util/InputUtil.isKeyPressed(JI)Z", ordinal = 5), cancellable = true) private void onKeyEvent(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo callbackInfo) { if (InputUtil.getKeycodeName(InputUtil.getKeyCode(key, scanCode).getKeyCode()) != null && InputUtil.getKeycodeName(InputUtil.getKeyCode(key, scanCode).getKeyCode()).equals(CommandManager.prefix)) { MinecraftClient.getInstance().openScreen(new ChatScreen(CommandManager.prefix)); } EventKeyPress event = new EventKeyPress(key, scanCode); BleachHack.eventBus.post(event); if (event.isCancelled()) callbackInfo.cancel(); }
Example #2
Source File: MixinKeyboard.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
@Inject(method = "onKey", at = @At(value = "INVOKE", target = "net/minecraft/client/util/InputUtil.isKeyPressed(JI)Z", ordinal = 5), cancellable = true) private void onKeyEvent(long windowPointer, int key, int scanCode, int action, int modifiers, CallbackInfo callbackInfo) { if (InputUtil.getKeycodeName(InputUtil.getKeyCode(key, scanCode).getKeyCode()) != null && InputUtil.getKeycodeName(InputUtil.getKeyCode(key, scanCode).getKeyCode()).equals(CommandManager.prefix)) { MinecraftClient.getInstance().openScreen(new ChatScreen(CommandManager.prefix)); } EventKeyPress event = new EventKeyPress(key, scanCode); BleachHack.eventBus.post(event); if (event.isCancelled()) callbackInfo.cancel(); }