Advertisement
Guest User

fullbright with reflection

a guest
Dec 20th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. package com.iseelemmon.hype.module.world;
  2.  
  3. import net.minecraft.potion.Potion;
  4. import net.minecraft.world.WorldType;
  5.  
  6. import org.lwjgl.input.Keyboard;
  7.  
  8. import com.darkmagician6.eventapi.EventManager;
  9. import com.darkmagician6.eventapi.EventTarget;
  10. import com.iseelemmon.hype.event.client.EventTick;
  11. import com.iseelemmon.hype.module.Module;
  12. import com.iseelemmon.hype.module.ModuleCategory;
  13.  
  14. public class Brightness extends Module{
  15.  
  16. private com.iseelemmon.hype.util.Timer timer = new com.iseelemmon.hype.util.Timer();
  17.  
  18. public Brightness() {
  19. super("Brightness", ModuleCategory.WORLD, Keyboard.KEY_B, 0xFAF9B9);
  20. }
  21.  
  22.  
  23. @Override
  24. protected void onEnable() {
  25. EventManager.register(this);
  26. if(getWrapper().getWorld() != null)
  27. getWrapper().getWorld().provider.terrainType = WorldType.FLAT;
  28. if(getWrapper().getPlayer() != null)
  29. getWrapper().getPlayer().removePotionEffect(Potion.blindness.id);
  30. }
  31.  
  32. @Override
  33. protected void onDisable() {
  34. getWrapper().getGameSettings().gammaSetting = 1F;
  35. EventManager.unregister(this);
  36. }
  37.  
  38. @EventTarget
  39. public final void onTick(final EventTick event){
  40. if(getWrapper().getPlayer() != null)
  41. getWrapper().getPlayer().removePotionEffect(Potion.blindness.id);
  42. if(timer.hasTimeElapsed(10) && getWrapper().getGameSettings().gammaSetting < 10){
  43. getWrapper().getGameSettings().gammaSetting += 0.1;
  44. timer.reset();
  45. }
  46. }
  47.  
  48. @Override
  49. protected void onLoad() {
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement