Skip to content

Commit 508ae13

Browse files
Added recommended Servers.
1 parent 96ecff2 commit 508ae13

File tree

3 files changed

+319
-99
lines changed

3 files changed

+319
-99
lines changed

patches/minecraft/net/minecraft/client/gui/GuiMultiplayer.edit.java

Lines changed: 114 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
# Version: 1.0
66
# Author: lax1dude
77

8-
> INSERT 2 : 4 @ 2
8+
> DELETE 2 @ 2 : 4
99

10-
+ import java.io.IOException;
11-
+
12-
13-
> CHANGE 2 : 17 @ 2 : 15
10+
> CHANGE 2 : 20 @ 2 : 13
1411

12+
~
13+
~ import com.google.common.base.Splitter;
14+
~ import com.google.common.collect.Lists;
1515
~
1616
~ import net.lax1dude.eaglercraft.v1_8.EagRuntime;
1717
~ import net.lax1dude.eaglercraft.v1_8.Keyboard;
@@ -35,7 +35,33 @@
3535
~ import net.minecraft.util.EnumChatFormatting;
3636
~ import net.minecraft.util.ResourceLocation;
3737

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
3965

4066
> INSERT 11 : 16 @ 11
4167

@@ -49,7 +75,7 @@
4975

5076
> INSERT 1 : 2 @ 1
5177

52-
+ private static long lastRefreshCommit = 0l;
78+
+ private int lastServerCount = -1; // Used to detect when the server list has changed
5379

5480
> INSERT 1 : 7 @ 1
5581

@@ -67,11 +93,21 @@
6793
+ lanServerList.forceRefresh();
6894
+ }
6995

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
71105

72106
~ this.savedServerList = ServerList.getServerList();
73107

74-
> DELETE 1 @ 1 : 10
108+
> DELETE 1 @ 1 : 2
109+
110+
> DELETE 1 @ 1 : 8
75111

76112
> INSERT 3 : 7 @ 3
77113

@@ -80,28 +116,58 @@
80116
+ }
81117
+ lanServerList.forceRefresh();
82118

83-
> INSERT 12 : 17 @ 12
119+
> INSERT 7 : 10 @ 7
120+
121+
+ /**
122+
+ * + Handles mouse input.
123+
+ */
124+
125+
> INSERT 5 : 10 @ 5
84126

85127
+ public void handleTouchInput() throws IOException {
86128
+ super.handleTouchInput();
87129
+ this.serverListSelector.handleTouchInput();
88130
+ }
89131
+
90132

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
92150

93151
~ this.savedServerList.updateServerPing();
94152
~ if (lanServerList.update()) {
95153
~ this.selectServer(-1);
154+
~ }
155+
~ ++ticksOpened;
96156

97-
> CHANGE 1 : 2 @ 1 : 3
157+
> INSERT 2 : 5 @ 2
98158

99-
~ ++ticksOpened;
159+
+ /**
160+
+ * + Called when the screen is unloaded. Used to disable keyboard repeat events
161+
+ */
100162

101-
> DELETE 4 @ 4 : 10
163+
> DELETE 2 @ 2 : 8
102164

103-
> CHANGE 2 : 3 @ 2 : 3
165+
> CHANGE 2 : 7 @ 2 : 3
104166

167+
~ /**
168+
~ * + Called by the controls from the buttonList when activated. (Mouse pressed
169+
~ * for buttons)
170+
~ */
105171
~ protected void actionPerformed(GuiButton parGuiButton) {
106172

107173
> CHANGE 19 : 21 @ 19 : 22
@@ -117,53 +183,33 @@
117183
~ this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.selectedServer));
118184
~ }
119185

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
129187

130188
~ public void refreshServerList() {
131189

132-
> CHANGE 14 : 19 @ 14 : 16
190+
> CHANGE 14 : 15 @ 14 : 16
133191

134-
~ long millis = EagRuntime.steadyTimeMillis();
135-
~ if (millis - lastRefreshCommit > 700l) {
136-
~ lastRefreshCommit = millis;
137-
~ this.refreshServerList();
138-
~ }
192+
~ this.refreshServerList();
139193

140194
> INSERT 10 : 13 @ 10
141195

142196
+ if (!this.selectedServer.enableCookies) {
143197
+ ServerCookieDataStore.clearCookie(this.selectedServer.serverIP);
144198
+ }
145199

146-
> CHANGE 5 : 10 @ 5 : 7
200+
> CHANGE 5 : 6 @ 5 : 7
147201

148-
~ long millis = EagRuntime.steadyTimeMillis();
149-
~ if (millis - lastRefreshCommit > 700l) {
150-
~ lastRefreshCommit = millis;
151-
~ this.refreshServerList();
152-
~ }
202+
~ this.refreshServerList();
153203

154204
> INSERT 6 : 9 @ 6
155205

156206
+ if (serverdata.enableCookies && !this.selectedServer.enableCookies) {
157207
+ ServerCookieDataStore.clearCookie(this.selectedServer.serverIP);
158208
+ }
159209

160-
> CHANGE 4 : 9 @ 4 : 6
210+
> CHANGE 4 : 5 @ 4 : 6
161211

162-
~ long millis = EagRuntime.steadyTimeMillis();
163-
~ if (millis - lastRefreshCommit > 700l) {
164-
~ lastRefreshCommit = millis;
165-
~ this.refreshServerList();
166-
~ }
212+
~ this.refreshServerList();
167213

168214
> INSERT 1 : 2 @ 1
169215

@@ -174,8 +220,13 @@
174220
+ public void cancelDirectConnect() {
175221
+ this.directConnect = false;
176222

177-
> CHANGE 2 : 3 @ 2 : 3
223+
> CHANGE 2 : 8 @ 2 : 3
178224

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+
~ */
179230
~ protected void keyTyped(char parChar1, int parInt1) {
180231

181232
> DELETE 18 @ 18 : 27
@@ -186,7 +237,14 @@
186237

187238
> DELETE 2 @ 2 : 11
188239

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
190248

191249
+ relaysButton.drawScreen(i, j);
192250
+ drawPluginDownloadLink(i, j);
@@ -260,8 +318,11 @@
260318

261319
> DELETE 2 @ 2 : 6
262320

263-
> CHANGE 4 : 6 @ 4 : 5
321+
> CHANGE 4 : 9 @ 4 : 5
264322

323+
~ /**
324+
~ * + Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
325+
~ */
265326
~ protected void mouseClicked(int parInt1, int parInt2, int parInt3) {
266327
~ relaysButton.mouseClicked(parInt1, parInt2, parInt3);
267328

@@ -275,7 +336,14 @@
275336
+ EagRuntime.openLink("https://lax1dude.net/eaglerxserver");
276337
+ }
277338

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
279347

280348
+ static LANServerList getLanServerList() {
281349
+ return lanServerList;

0 commit comments

Comments
 (0)