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

Class Variables

Minecraft-Utils/1.8.8/src/Variables.java:35–1288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33import java.util.*;
34
35public class Variables implements IVariables {
36
37 private static Field forgeChatField;
38 private static Method rightClickMouse;
39
40 static {
41 if (Transformer.FORGE) {
42 try {
43 forgeChatField = Names.guiChat.load().getDeclaredField("field_146415_a");
44 forgeChatField.setAccessible(true);
45 rightClickMouse = Names.minecraft.load().getDeclaredMethod("func_147121_ag");
46 rightClickMouse.setAccessible(true);
47 } catch (Exception e) {
48 throw new RuntimeException(e);
49 }
50 } else {
51 try {
52 rightClickMouse = Names.minecraft.load().getDeclaredMethod("ax");
53 rightClickMouse.setAccessible(true);
54 } catch (Exception e) {
55 throw new RuntimeException(e);
56 }
57 }
58 }
59
60 private avr scaledResolution;
61 private IGui2ndChat gui2ndChat = new Gui2ndChat();
62
63 private final ResourceManager resourceManager;
64 private Kernel32.SYSTEM_POWER_STATUS batteryStatus;
65
66 private static final List<PotionEffectImpl> DUMMY_POTIONS = Arrays.asList(new PotionEffectImpl("potion.jump", 20, "0:01", 1, 10, true, true, 0x22ff4c),
67 new PotionEffectImpl("potion.moveSpeed", 20 * 50, "0:50", 1, 0, true, true, 0x7cafc6));
68
69 public Variables() {
70 eu.the5zig.mod.util.Keyboard.initLegacy(new eu.the5zig.mod.util.Keyboard.KeyboardHandler() {
71 @Override
72 public boolean isKeyDown(int key) {
73 return org.lwjgl.input.Keyboard.isKeyDown(key);
74 }
75
76 @Override
77 public void enableRepeatEvents(boolean repeat) {
78 eu.the5zig.mod.util.Keyboard.enableRepeatEvents(repeat);
79 }
80 });
81 Mouse.init(new Mouse.MouseHandler() {
82 @Override
83 public boolean isButtonDown(int button) {
84 return org.lwjgl.input.Mouse.isButtonDown(button);
85 }
86
87 @Override
88 public int getX() {
89 return org.lwjgl.input.Mouse.getX();
90 }
91
92 @Override

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected