Advertisement
AcidLizard11

mod_FogKey.java

Sep 9th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1.  
  2. package net.minecraft.src;
  3.  
  4. import java.util.Random;
  5. import org.lwjgl.input.Keyboard;
  6.  
  7. public class mod_FogKey extends BaseMod {
  8.  
  9. public KeyBinding FogKey = new KeyBinding("FogKey", Keyboard.KEY_F);
  10.  
  11.  
  12.     public void load()
  13.     {
  14.         ModLoader.registerKey(this, FogKey, false);
  15.         ModLoader.addLocalization("FogKey", "Fog Key");
  16.         ModLoader.setInGameHook(this, true, true);
  17.     }
  18.  
  19.     public void keyboardEvent (KeyBinding keybinding)
  20.     {
  21.         Minecraft mc = ModLoader.getMinecraftInstance();
  22.         GameSettings gamesettings = mc.gameSettings;
  23.         if(keybinding == this.FogKey)
  24.         {
  25.             if(mc.currentScreen == null)
  26.             {
  27.                 mc.gameSettings.renderDistance = mc.gameSettings.renderDistance + (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54) ? -1 : 1) & 3;
  28.             }
  29.         }
  30.     }
  31.  
  32.  
  33.     public String getVersion()
  34.     {
  35.             return "F Key for MC 1.6.2";
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement