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

Method Variables

Minecraft-Utils/1.13/src/Variables.java:67–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 12

initMethod · 0.95
initMethod · 0.95
initMethod · 0.95
getMinecraftMethod · 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