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

Method patchMainMenu

Minecraft-Utils/1.8.9/src/ClassProxy.java:90–131  ·  view source on GitHub ↗
(Object instance, int paramInt1, int paramInt2, boolean isForge)

Source from the content-addressed store, hash-verified

88 }
89
90 public static void patchMainMenu(Object instance, int paramInt1, int paramInt2, boolean isForge) {
91 aya guiMainMenu = (aya) instance;
92 if (!MinecraftFactory.getClassProxyCallback().isShowLastServer())
93 return;
94 String lastServer;
95 IButton button;
96 String server = MinecraftFactory.getClassProxyCallback().getLastServer();
97 int x = guiMainMenu.l / 2 + 2;
98 int y = paramInt1 + paramInt2;
99 if (server != null) {
100 String[] parts = server.split(":");
101 String host = parts[parts.length - 2];
102 int port = Integer.parseInt(parts[parts.length - 1]);
103 if (port == 25565) {
104 lastServer = host;
105 } else {
106 lastServer = host + ":" + port;
107 }
108 lastServer = MinecraftFactory.getVars().shortenToWidth(lastServer, 88);
109 button = MinecraftFactory.getVars().createButton(99, x, y, 98, 20, lastServer);
110 } else {
111 button = MinecraftFactory.getVars().createButton(98, x, y, 98, 20, MinecraftFactory.getClassProxyCallback().translate("menu.no_last_server"));
112 }
113 List<avs> list;
114 if (Transformer.FORGE) {
115 try {
116 list = ((List<avs>) buttonList.get(guiMainMenu));
117 } catch (Exception e) {
118 throw new RuntimeException(e);
119 }
120 } else {
121 list = guiMainMenu.n;
122 }
123 list.add((avs) button);
124
125 for (avs b : list) {
126 int id = b.k;
127 if (id == 2) {
128 b.f = 98;
129 }
130 }
131 }
132
133 public static void guiMainActionPerformed(Object b) {
134 avs button = (avs) b;

Callers

nothing calls this directly

Calls 10

getClassProxyCallbackMethod · 0.95
getVarsMethod · 0.95
isShowLastServerMethod · 0.65
getLastServerMethod · 0.65
shortenToWidthMethod · 0.65
createButtonMethod · 0.65
translateMethod · 0.65
getMethod · 0.65
parseIntMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected