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

Class Variables

Minecraft-Utils/1.8/src/Variables.java:32–1271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getNameMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected