package info.u_team.u_team_test.init;

import org.lwjgl.glfw.GLFW;

import info.u_team.u_team_core.util.registry.ClientRegistry;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.screen.ButtonTestScreen;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.util.InputMappings;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.GuiScreenEvent.KeyboardKeyPressedEvent;
import net.minecraftforge.eventbus.api.*;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

public class TestKeys {
	
	public static final KeyBinding BASIC = new KeyBinding("Basic key", GLFW.GLFW_KEY_F8, "Basic category");
	
	public static void setup(FMLClientSetupEvent event) {
		ClientRegistry.registerKeybinding(BASIC);
	}
	
	public static void registerMod(IEventBus bus) {
		bus.addListener(TestKeys::setup);
	}
	
	@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.FORGE, value = Dist.CLIENT)
	public static class Handler {
		
		@SubscribeEvent
		public static void keyPressInGui(KeyboardKeyPressedEvent.Post event) {
			if (BASIC.isActiveAndMatches(InputMappings.getInputByCode(event.getKeyCode(), event.getScanCode()))) {
				Minecraft.getInstance().displayGuiScreen(new ButtonTestScreen());
				event.setCanceled(true);
			}
		}
	}
}

@@ -126,48 +126,8 @@
 ry;%0A
-import info.u_team.u_team_test.TestMod;%0A
 impo
@@ -318,55 +318,8 @@
 gs;%0A
-import net.minecraftforge.api.distmarker.Dist;%0A
 impo
@@ -436,132 +436,14 @@
 api.
-*;%0Aimport net.minecraftforge.fml.common.Mod.EventBusSubscriber;%0Aimport net.minecraftforge.fml.common.Mod.EventBusSubscriber.
+IEvent
 Bus;
@@ -642,29 +642,30 @@
 gory%22);%0A%09%0A%09p
-ublic
+rivate
  static void
@@ -747,29 +747,30 @@
 IC);%0A%09%7D%0A%09%0A%09p
-ublic
+rivate
  static void
@@ -774,246 +774,25 @@
 oid 
-registerMod(IEventBus bus) %7B%0A%09%09bus.addListener(TestKeys::setup);%0A%09%7D%0A%09%0A%09@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.FORGE, value = Dist.CLIENT)%0A%09public static class Handler %7B%0A%09%09%0A%09%09@SubscribeEvent%0A%09%09public static void keyPressInGui
+onKeyboardPressed
 (Key
@@ -826,17 +826,16 @@
 vent) %7B%0A
-%09
 %09%09if (BA
@@ -934,17 +934,16 @@
 )) %7B%0A%09%09%09
-%09
 Minecraf
@@ -1003,17 +1003,16 @@
 ());%0A%09%09%09
-%09
 event.se
@@ -1034,16 +1034,207 @@
 ;%0A%09%09
+%7D%0A
 %09%7D%0A%09
+%0A%09public static void registerMod(IEventBus bus) %7B%0A%09%09bus.addListener(TestKeys::setup);%0A%09%7D%0A%09%0A%09public static void registerForge(IEventBus bus) %7B%0A%09%09bus.addListener(TestKeys::onKeyboardPressed);%0A
 %09%7D%0A%09
-%7D
 %0A%7D%0A

Move the other register class too