Posted May 17, 20178 yr Does forge allow to get latest visited server? Or actual server list? Or maybe somehow decrypt servers.dat?
May 17, 20178 yr You can make a new instance of ServerList using the Minecraft class (AKA client-side-only), and call the ServerData#loadServerList method, which will read the servers into a List<ServerData>. ServerData has multiple methods to get/remove/modify the List<ServerData>. This might not be the best way to do it, I couldn't find a better way in the little time I spend researching. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 17, 20178 yr Author 45 minutes ago, larsgerrits said: You can make a new instance of ServerList using the Minecraft class (AKA client-side-only), and call the ServerData#loadServerList method, which will read the servers into a List<ServerData>. ServerData has multiple methods to get/remove/modify the List<ServerData>. This might not be the best way to do it, I couldn't find a better way in the little time I spend researching. How can I make that instance? I surfed the internet, but I found nothing. If you can-please, help with this :3
May 17, 20178 yr new ServerList? Edited May 17, 20178 yr by larsgerrits Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 17, 20178 yr Author 1 minute ago, larsgerrits said: new ServerList? And you said to use Minecraft class.
May 17, 20178 yr Yes, the constructor of ServerList takes an instance of the Minecraft class, which you can get using Minecraft.getMinecraft(). Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 17, 20178 yr Author 3 minutes ago, larsgerrits said: Yes, the constructor of ServerList takes an instance of the Minecraft class, which you can get using Minecraft.getMinecraft(). Holy, I am so stupid even in this simple part of code. Sorry again. So I`ve typed this: Minecraft mc = Minecraft.getMinecraft(); What I have to do next?
May 17, 20178 yr Author 33 minutes ago, Jay Avery said: Do you know how to call a constructor with parameters? Yep
May 18, 20178 yr Author 8 hours ago, Jay Avery said: So, call the ServerList constructor with a Minecraft parameter. Okey, finally I've called that constructor with MC parameter. That's next? The mission is to get server name/names.
May 18, 20178 yr 15 hours ago, larsgerrits said: call the ServerData#loadServerList method, which will read the servers into a List<ServerData>. ServerData has multiple methods to get/remove/modify the List<ServerData>. ServerData contains the name, IP and other information about a server. Edited May 18, 20178 yr by larsgerrits Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 18, 20178 yr Author 4 hours ago, larsgerrits said: ServerData contains the name, IP and other information about a server. @larsgerrits, void getServers() { ServerList list = new ServerList(Minecraft.getMinecraft()); list.loadServerList(); } Is that correct on this point? What must I do next? Sorry for being stupid... You wrote about ServerData. How can I call it? Can`t get it at all...
May 18, 20178 yr If you look at the class, you can see all the methods you can call on it, including ways to get an instance of ServerData (ServerList#getServerData(index)). Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
May 18, 20178 yr Author Guys, I ADORE YOU SO MUCH! Finally, I did that. Now I know a bit more about Forge Thanks again for your patient and support!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.