|
5 | 5 | # Version: 1.0 |
6 | 6 | # Author: lax1dude |
7 | 7 |
|
8 | | -> INSERT 2 : 4 @ 2 |
| 8 | +> DELETE 2 @ 2 : 4 |
9 | 9 |
|
10 | | -+ import java.io.IOException; |
11 | | -+ |
12 | | - |
13 | | -> CHANGE 2 : 17 @ 2 : 15 |
| 10 | +> CHANGE 2 : 20 @ 2 : 13 |
14 | 11 |
|
| 12 | +~ |
| 13 | +~ import com.google.common.base.Splitter; |
| 14 | +~ import com.google.common.collect.Lists; |
15 | 15 | ~ |
16 | 16 | ~ import net.lax1dude.eaglercraft.v1_8.EagRuntime; |
17 | 17 | ~ import net.lax1dude.eaglercraft.v1_8.Keyboard; |
|
35 | 35 | ~ import net.minecraft.util.EnumChatFormatting; |
36 | 36 | ~ import net.minecraft.util.ResourceLocation; |
37 | 37 |
|
38 | | -> DELETE 3 @ 3 : 4 |
| 38 | +> INSERT 1 : 24 @ 1 |
| 39 | + |
| 40 | ++ /** |
| 41 | ++ * + This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source |
| 42 | ++ * code. |
| 43 | ++ * |
| 44 | ++ * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod |
| 45 | ++ * Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team |
| 46 | ++ * |
| 47 | ++ * EaglercraftX 1.8 patch files (c) 2022-2025 lax1dude, ayunami2000. All Rights |
| 48 | ++ * Reserved. |
| 49 | ++ * |
| 50 | ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 51 | ++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 52 | ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 53 | ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 54 | ++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 55 | ++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 56 | ++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 57 | ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 58 | ++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 59 | ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 60 | ++ * POSSIBILITY OF SUCH DAMAGE. |
| 61 | ++ * |
| 62 | ++ */ |
| 63 | + |
| 64 | +> DELETE 2 @ 2 : 3 |
39 | 65 |
|
40 | 66 | > INSERT 11 : 16 @ 11 |
41 | 67 |
|
|
49 | 75 |
|
50 | 76 | > INSERT 1 : 2 @ 1 |
51 | 77 |
|
52 | | -+ private static long lastRefreshCommit = 0l; |
| 78 | ++ private int lastServerCount = -1; // Used to detect when the server list has changed |
53 | 79 |
|
54 | 80 | > INSERT 1 : 7 @ 1 |
55 | 81 |
|
|
67 | 93 | + lanServerList.forceRefresh(); |
68 | 94 | + } |
69 | 95 |
|
70 | | -> CHANGE 7 : 8 @ 7 : 8 |
| 96 | +> INSERT 2 : 7 @ 2 |
| 97 | + |
| 98 | ++ /** |
| 99 | ++ * + Adds the buttons (and other controls) to the screen in question. Called |
| 100 | ++ * when the GUI is displayed and when the window resizes, the buttonList is |
| 101 | ++ * cleared beforehand. |
| 102 | ++ */ |
| 103 | + |
| 104 | +> CHANGE 5 : 6 @ 5 : 6 |
71 | 105 |
|
72 | 106 | ~ this.savedServerList = ServerList.getServerList(); |
73 | 107 |
|
74 | | -> DELETE 1 @ 1 : 10 |
| 108 | +> DELETE 1 @ 1 : 2 |
| 109 | + |
| 110 | +> DELETE 1 @ 1 : 8 |
75 | 111 |
|
76 | 112 | > INSERT 3 : 7 @ 3 |
77 | 113 |
|
|
80 | 116 | + } |
81 | 117 | + lanServerList.forceRefresh(); |
82 | 118 |
|
83 | | -> INSERT 12 : 17 @ 12 |
| 119 | +> INSERT 7 : 10 @ 7 |
| 120 | + |
| 121 | ++ /** |
| 122 | ++ * + Handles mouse input. |
| 123 | ++ */ |
| 124 | + |
| 125 | +> INSERT 5 : 10 @ 5 |
84 | 126 |
|
85 | 127 | + public void handleTouchInput() throws IOException { |
86 | 128 | + super.handleTouchInput(); |
87 | 129 | + this.serverListSelector.handleTouchInput(); |
88 | 130 | + } |
89 | 131 | + |
90 | 132 |
|
91 | | -> CHANGE 20 : 23 @ 20 : 24 |
| 133 | +> INSERT 18 : 21 @ 18 |
| 134 | + |
| 135 | ++ /** |
| 136 | ++ * + Called from the main game loop to update the screen. |
| 137 | ++ */ |
| 138 | + |
| 139 | +> CHANGE 2 : 9 @ 2 : 6 |
| 140 | + |
| 141 | +~ |
| 142 | +~ // Check if the total number of servers (local + remote) has changed |
| 143 | +~ int currentServerCount = this.savedServerList.countServers(); |
| 144 | +~ if (this.lastServerCount != currentServerCount) { |
| 145 | +~ this.lastServerCount = currentServerCount; |
| 146 | +~ // The list has been updated (e.g., by the async fetch), so rebuild the GUI list |
| 147 | +~ this.serverListSelector.func_148195_a(this.savedServerList); |
| 148 | + |
| 149 | +> CHANGE 2 : 7 @ 2 : 3 |
92 | 150 |
|
93 | 151 | ~ this.savedServerList.updateServerPing(); |
94 | 152 | ~ if (lanServerList.update()) { |
95 | 153 | ~ this.selectServer(-1); |
| 154 | +~ } |
| 155 | +~ ++ticksOpened; |
96 | 156 |
|
97 | | -> CHANGE 1 : 2 @ 1 : 3 |
| 157 | +> INSERT 2 : 5 @ 2 |
98 | 158 |
|
99 | | -~ ++ticksOpened; |
| 159 | ++ /** |
| 160 | ++ * + Called when the screen is unloaded. Used to disable keyboard repeat events |
| 161 | ++ */ |
100 | 162 |
|
101 | | -> DELETE 4 @ 4 : 10 |
| 163 | +> DELETE 2 @ 2 : 8 |
102 | 164 |
|
103 | | -> CHANGE 2 : 3 @ 2 : 3 |
| 165 | +> CHANGE 2 : 7 @ 2 : 3 |
104 | 166 |
|
| 167 | +~ /** |
| 168 | +~ * + Called by the controls from the buttonList when activated. (Mouse pressed |
| 169 | +~ * for buttons) |
| 170 | +~ */ |
105 | 171 | ~ protected void actionPerformed(GuiButton parGuiButton) { |
106 | 172 |
|
107 | 173 | > CHANGE 19 : 21 @ 19 : 22 |
|
117 | 183 | ~ this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.selectedServer)); |
118 | 184 | ~ } |
119 | 185 |
|
120 | | -> CHANGE 3 : 8 @ 3 : 4 |
121 | | - |
122 | | -~ long millis = EagRuntime.steadyTimeMillis(); |
123 | | -~ if (millis - lastRefreshCommit > 700l) { |
124 | | -~ lastRefreshCommit = millis; |
125 | | -~ this.refreshServerList(); |
126 | | -~ } |
127 | | - |
128 | | -> CHANGE 5 : 6 @ 5 : 6 |
| 186 | +> CHANGE 9 : 10 @ 9 : 10 |
129 | 187 |
|
130 | 188 | ~ public void refreshServerList() { |
131 | 189 |
|
132 | | -> CHANGE 14 : 19 @ 14 : 16 |
| 190 | +> CHANGE 14 : 15 @ 14 : 16 |
133 | 191 |
|
134 | | -~ long millis = EagRuntime.steadyTimeMillis(); |
135 | | -~ if (millis - lastRefreshCommit > 700l) { |
136 | | -~ lastRefreshCommit = millis; |
137 | | -~ this.refreshServerList(); |
138 | | -~ } |
| 192 | +~ this.refreshServerList(); |
139 | 193 |
|
140 | 194 | > INSERT 10 : 13 @ 10 |
141 | 195 |
|
142 | 196 | + if (!this.selectedServer.enableCookies) { |
143 | 197 | + ServerCookieDataStore.clearCookie(this.selectedServer.serverIP); |
144 | 198 | + } |
145 | 199 |
|
146 | | -> CHANGE 5 : 10 @ 5 : 7 |
| 200 | +> CHANGE 5 : 6 @ 5 : 7 |
147 | 201 |
|
148 | | -~ long millis = EagRuntime.steadyTimeMillis(); |
149 | | -~ if (millis - lastRefreshCommit > 700l) { |
150 | | -~ lastRefreshCommit = millis; |
151 | | -~ this.refreshServerList(); |
152 | | -~ } |
| 202 | +~ this.refreshServerList(); |
153 | 203 |
|
154 | 204 | > INSERT 6 : 9 @ 6 |
155 | 205 |
|
156 | 206 | + if (serverdata.enableCookies && !this.selectedServer.enableCookies) { |
157 | 207 | + ServerCookieDataStore.clearCookie(this.selectedServer.serverIP); |
158 | 208 | + } |
159 | 209 |
|
160 | | -> CHANGE 4 : 9 @ 4 : 6 |
| 210 | +> CHANGE 4 : 5 @ 4 : 6 |
161 | 211 |
|
162 | | -~ long millis = EagRuntime.steadyTimeMillis(); |
163 | | -~ if (millis - lastRefreshCommit > 700l) { |
164 | | -~ lastRefreshCommit = millis; |
165 | | -~ this.refreshServerList(); |
166 | | -~ } |
| 212 | +~ this.refreshServerList(); |
167 | 213 |
|
168 | 214 | > INSERT 1 : 2 @ 1 |
169 | 215 |
|
|
174 | 220 | + public void cancelDirectConnect() { |
175 | 221 | + this.directConnect = false; |
176 | 222 |
|
177 | | -> CHANGE 2 : 3 @ 2 : 3 |
| 223 | +> CHANGE 2 : 8 @ 2 : 3 |
178 | 224 |
|
| 225 | +~ /** |
| 226 | +~ * + Fired when a key is typed (except F11 which toggles full screen). This is |
| 227 | +~ * the equivalent of KeyListener.keyTyped(KeyEvent e). Args : character |
| 228 | +~ * (character on the key), keyCode (lwjgl Keyboard key code) |
| 229 | +~ */ |
179 | 230 | ~ protected void keyTyped(char parChar1, int parInt1) { |
180 | 231 |
|
181 | 232 | > DELETE 18 @ 18 : 27 |
|
186 | 237 |
|
187 | 238 | > DELETE 2 @ 2 : 11 |
188 | 239 |
|
189 | | -> INSERT 22 : 24 @ 22 |
| 240 | +> INSERT 15 : 19 @ 15 |
| 241 | + |
| 242 | ++ /** |
| 243 | ++ * + Draws the screen and all the components in it. Args : mouseX, mouseY, |
| 244 | ++ * renderPartialTicks |
| 245 | ++ */ |
| 246 | + |
| 247 | +> INSERT 7 : 9 @ 7 |
190 | 248 |
|
191 | 249 | + relaysButton.drawScreen(i, j); |
192 | 250 | + drawPluginDownloadLink(i, j); |
|
260 | 318 |
|
261 | 319 | > DELETE 2 @ 2 : 6 |
262 | 320 |
|
263 | | -> CHANGE 4 : 6 @ 4 : 5 |
| 321 | +> CHANGE 4 : 9 @ 4 : 5 |
264 | 322 |
|
| 323 | +~ /** |
| 324 | +~ * + Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton |
| 325 | +~ */ |
265 | 326 | ~ protected void mouseClicked(int parInt1, int parInt2, int parInt3) { |
266 | 327 | ~ relaysButton.mouseClicked(parInt1, parInt2, parInt3); |
267 | 328 |
|
|
275 | 336 | + EagRuntime.openLink("https://lax1dude.net/eaglerxserver"); |
276 | 337 | + } |
277 | 338 |
|
278 | | -> INSERT 11 : 15 @ 11 |
| 339 | +> INSERT 2 : 6 @ 2 |
| 340 | + |
| 341 | ++ /** |
| 342 | ++ * + Called when a mouse button is released. Args : mouseX, mouseY, |
| 343 | ++ * releaseButton |
| 344 | ++ */ |
| 345 | + |
| 346 | +> INSERT 9 : 13 @ 9 |
279 | 347 |
|
280 | 348 | + static LANServerList getLanServerList() { |
281 | 349 | + return lanServerList; |
|
0 commit comments