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

Class Variables

Minecraft-Utils/1.12.2/src/Variables.java:31–1313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29import java.util.*;
30
31public class Variables implements IVariables {
32
33 private static Field forgeChatField;
34 private static Method rightClickMouse;
35
36 static {
37 if (Transformer.FORGE) {
38 try {
39 forgeChatField = Names.guiChat.load().getDeclaredField("field_146415_a");
40 forgeChatField.setAccessible(true);
41 rightClickMouse = Names.minecraft.load().getDeclaredMethod("func_147121_ag");
42 rightClickMouse.setAccessible(true);
43 } catch (Exception e) {
44 throw new RuntimeException(e);
45 }
46 } else {
47 try {
48 rightClickMouse = Names.minecraft.load().getDeclaredMethod(Names.rightClickMouse.getName());
49 rightClickMouse.setAccessible(true);
50 } catch (Exception e) {
51 throw new RuntimeException(e);
52 }
53 }
54 }
55
56 private bit scaledResolution;
57 private IGui2ndChat gui2ndChat = new Gui2ndChat();
58
59 private final ResourceManager resourceManager;
60 private Kernel32.SYSTEM_POWER_STATUS batteryStatus;
61
62 private static final List<PotionEffectImpl> DUMMY_POTIONS = Arrays.asList(new PotionEffectImpl("effect.jump", 20, "0:01", 1, 10, true, true, 0x22ff4c),
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

Callers

nothing calls this directly

Calls 2

loadMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected