Advertisement
Gamebuster

ClientProxy

Jun 30th, 2017
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.67 KB | None | 0 0
  1. package com.gamebuster19901.RDP.proxy.key;
  2.  
  3. import org.lwjgl.input.Keyboard;
  4.  
  5. import com.gamebuster19901.RDP.proxy.CommonProxy;
  6.  
  7. import net.minecraft.client.settings.KeyBinding;
  8. import net.minecraftforge.common.MinecraftForge;
  9. import net.minecraftforge.fml.client.registry.ClientRegistry;
  10. import net.minecraftforge.fml.common.Mod.EventHandler;
  11. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  12. import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
  13. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  14.  
  15. import static com.gamebuster19901.RDP.Main.MODID;
  16.  
  17. public class ClientProxy extends CommonProxy{
  18.     static final AbsoluteKeyBinding[] KEYBINDINGS = new AbsoluteKeyBinding[]{
  19.         new AbsoluteKeyBinding("key." + MODID + "up.description", Keyboard.KEY_UP, "key." + MODID + ".up"),
  20.         new AbsoluteKeyBinding("key." + MODID + "right.description", Keyboard.KEY_RIGHT, "key." + MODID + ".right"),
  21.         new AbsoluteKeyBinding("key." + MODID + "down.description", Keyboard.KEY_DOWN, "key." + MODID + ".down"),
  22.         new AbsoluteKeyBinding("key." + MODID + "left.description", Keyboard.KEY_LEFT, "key." + MODID + ".left")
  23.     };
  24.    
  25.     @EventHandler
  26.     @Override
  27.     public void preInit(FMLPreInitializationEvent e){
  28.         super.preInit(e);
  29.         MinecraftForge.EVENT_BUS.register(KeyEventHandler.INSTANCE);
  30.         for(KeyBinding kb : KEYBINDINGS){
  31.             ClientRegistry.registerKeyBinding(kb);
  32.         }
  33.     }
  34.    
  35.     @EventHandler
  36.     @Override
  37.     public void init(FMLInitializationEvent e){
  38.         super.init(e);
  39.     }
  40.    
  41.     @EventHandler
  42.     @Override
  43.     public void postInit(FMLPostInitializationEvent e){
  44.         super.postInit(e);
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement