(Object instance, int paramInt1, int paramInt2, boolean isForge)
| 99 | } |
| 100 | |
| 101 | public static void patchMainMenu(Object instance, int paramInt1, int paramInt2, boolean isForge) { |
| 102 | cjx guiMainMenu = (cjx) instance; |
| 103 | if (!MinecraftFactory.getClassProxyCallback().isShowLastServer()) |
| 104 | return; |
| 105 | String lastServer; |
| 106 | IButton button; |
| 107 | String server = MinecraftFactory.getClassProxyCallback().getLastServer(); |
| 108 | int x = guiMainMenu.m / 2 + 2; |
| 109 | int y = paramInt1 + paramInt2; |
| 110 | if (server != null) { |
| 111 | String[] parts = server.split(":"); |
| 112 | String host = parts[parts.length - 2]; |
| 113 | int port = Integer.parseInt(parts[parts.length - 1]); |
| 114 | if (port == 25565) { |
| 115 | lastServer = host; |
| 116 | } else { |
| 117 | lastServer = host + ":" + port; |
| 118 | } |
| 119 | lastServer = MinecraftFactory.getVars().shortenToWidth(lastServer, 88); |
| 120 | button = new Button(99, x, y, 98, 20, lastServer) { |
| 121 | @Override |
| 122 | protected void onClick(double mouseX, double mouseY) { |
| 123 | String server = MinecraftFactory.getClassProxyCallback().getLastServer(); |
| 124 | if (server == null) |
| 125 | return; |
| 126 | String[] parts = server.split(":"); |
| 127 | String host = parts[parts.length - 2]; |
| 128 | int port = Integer.parseInt(parts[parts.length - 1]); |
| 129 | MinecraftFactory.getVars().joinServer(host, port); |
| 130 | } |
| 131 | }; |
| 132 | } else { |
| 133 | button = MinecraftFactory.getVars().createButton(98, x, y, 98, 20, MinecraftFactory.getClassProxyCallback().translate("menu.no_last_server")); |
| 134 | } |
| 135 | guiMainMenu.a((cgj) button); |
| 136 | List<cgj> list; |
| 137 | if (Transformer.FORGE) { |
| 138 | try { |
| 139 | list = ((List<cgj>) buttonList.get(guiMainMenu)); |
| 140 | } catch (Exception e) { |
| 141 | throw new RuntimeException(e); |
| 142 | } |
| 143 | } else { |
| 144 | list = guiMainMenu.o; |
| 145 | } |
| 146 | |
| 147 | for (cgj b : list) { |
| 148 | int id = b.k; |
| 149 | if (id == 2) { |
| 150 | b.f = 98; |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | public static void guiMainActionPerformed(Object b) { |
| 156 | cgj button = (cgj) b; |
nothing calls this directly
no test coverage detected