MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / Variables

Method Variables

Minecraft-Utils/1.12.2/src/Variables.java:65–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63 new PotionEffectImpl("effect.moveSpeed", 20 * 50, "0:50", 1, 0, true, true, 0x7cafc6));
64
65 public Variables() {
66 Keyboard.initLegacy(new Keyboard.KeyboardHandler() {
67 @Override
68 public boolean isKeyDown(int key) {
69 return org.lwjgl.input.Keyboard.isKeyDown(key);
70 }
71
72 @Override
73 public void enableRepeatEvents(boolean repeat) {
74 Keyboard.enableRepeatEvents(repeat);
75 }
76 });
77 Mouse.init(new Mouse.MouseHandler() {
78 @Override
79 public boolean isButtonDown(int button) {
80 return org.lwjgl.input.Mouse.isButtonDown(button);
81 }
82
83 @Override
84 public int getX() {
85 return org.lwjgl.input.Mouse.getX();
86 }
87
88 @Override
89 public int getY() {
90 return org.lwjgl.input.Mouse.getY();
91 }
92 });
93 Display.init(new Display.DisplayHandler() {
94 @Override
95 public boolean isActive() {
96 return org.lwjgl.opengl.Display.isActive();
97 }
98 });
99 updateScaledResolution();
100 try {
101 this.resourceManager = new ResourceManager(getGameProfile());
102 } catch (Exception e) {
103 throw new RuntimeException(e);
104 }
105 try {
106 Class<?> enumGameSettings = Names.gameOption.load();
107 Method setMaxValue = Transformer.FORGE ? enumGameSettings.getDeclaredMethod("func_148263_a", float.class) : enumGameSettings.getDeclaredMethod("a", float.class);
108 Field gamma = Transformer.FORGE ? enumGameSettings.getDeclaredField("GAMMA") : enumGameSettings.getDeclaredField("d");
109 setMaxValue.invoke(gamma.get(null), 10.0f);
110 Field fov = Transformer.FORGE ? enumGameSettings.getDeclaredField("FOV") : enumGameSettings.getDeclaredField("c");
111 setMaxValue.invoke(fov.get(null), 130f);
112 } catch (Exception e) {
113 MinecraftFactory.getClassProxyCallback().getLogger().warn("Could not patch game settings", e);
114 }
115 if (Utils.getPlatform() == Utils.Platform.WINDOWS) {
116 try {
117 batteryStatus = new Kernel32.SYSTEM_POWER_STATUS();
118 } catch (Throwable ignored) {
119 }
120 }
121 }
122

Callers

nothing calls this directly

Calls 11

initLegacyMethod · 0.95
initMethod · 0.95
initMethod · 0.95
getGameProfileMethod · 0.95
getClassProxyCallbackMethod · 0.95
getPlatformMethod · 0.95
getMethod · 0.65
getLoggerMethod · 0.65
loadMethod · 0.45
invokeMethod · 0.45

Tested by

no test coverage detected