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

Method Variables

Minecraft-Utils/1.8.9/src/Variables.java:66–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected