Posted February 8, 201510 yr I have a modpack and I am working on a mod to put in it that I want to automatically a.) Check to see if the official server is on the list and b.) add it to the server list if it isn't already there. How would I go about doing that? If I helped please press the Thank You button. Check out my mods at http://www.curse.com/users/The_Fireplace/projects
February 8, 201510 yr You don't need a mod for that. Just go to your Minecraft, remove all servers and add the default one. Copy the servers.dat file in .minecraft to your mod pack main directory. Maker of the Craft++ mod.
February 8, 201510 yr If you really want to do it from mod, why not looking into GuiMultiplayer? Two ways: 1. Decode servers.dat (I belive it's NBT format, check out read/write methods) on mod startup, check if server entry exists and add your own if not. 2. Add server entry manually in gui screen. Few things: - You can only add the servers when the Gui is opened. Since GuiMultiplayer extends GuiScreen you can subscribe to GuiOpenEvent check if newGui is instanceof GuiMultiplayer and if so, pass an argument to add entry if it doesn't exist. Edit: Actually no, GuiOpenEvent will be fired before server lists exist (I think), so you will have to make some Integer in client proxy which will be your "delay" and then launch code (you will also need ClientTickEvent to count-down). Provide some code for more help. 1.7.10 is no longer supported by forge, you are on your own.
February 8, 201510 yr Author You don't need a mod for that. Just go to your Minecraft, remove all servers and add the default one. Copy the servers.dat file in .minecraft to your mod pack main directory. Wouldt that remove other servers the user has added every time the pack updates? Just because I want to add the official server doesn't mean no other server will be running the modpack. If I helped please press the Thank You button. Check out my mods at http://www.curse.com/users/The_Fireplace/projects
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.