Jump to content

[1.7.2]Forge now has config ("options") GUI functionality


jabelar

Recommended Posts

Just wanted to let people know that the 1147 release of Forge includes a feature many of us have been waiting for -- that options button in the mod loader now works, with config GUI functionality. 

 

There is a tutorial here on it.  I'm going to try it today, can't wait.  http://minalien.com/minecraft-forge-feature-spotlight-config-guis/

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

You could make a configuration GUI 4 months ago.

The new code is utility stuff.

 

Well it is never too late to start showing interest.

 

Are you saying they already had GuiConfig class before, the IModGuiFactory interface, and the ConfigChangedEvent on the FML bus?  This is new stuff, I'm pretty sure.  I didn't see those events when I made a list of all Event subclasses on recent previous releases.

 

You could of course make your own config GUI before, but this is now the official method for using that built-in "Options" button on the loading screen when you look at the list of mods.  It automatically parses your config and creates the buttons, adds undo and restore to defaults, etc.

 

 

Anyway, I just tried it and it works great.  Took a mod that was already using a config file and now all the options are available in the mod list and when I change them they properly apply to the game when loaded.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Check the FML github.

IModGuiFactory was published 6 months ago.

GuiConfig and ConfigChangedEvent are utilities, they are not needed for a configuration screen to work.

I am not saying that new stuff is useless, it is some good work indeed.

But you could have made your own gui instead of waiting.

Link to comment
Share on other sites

Okay.  I got excited because the release notes for these recent releases focused on a lot of comments related to merging these functions, and also other people picked up on it -- for example the tutorial I found was "news" about the new feature.

 

GuiConfig and ConfigChangedEvent are utilities, they are not needed for a configuration screen to work.

 

Yeah, sure anyone can extend GuiScreen and create a custom event to post, but these are the "official" utilities.  It is like the fiasco with the Netty handling where several people came up with their own packet systems then people started using some of those only to find they were flawed, and then finally the simple network wrapper system seems ready to go.  It is true that anyone could create a packet system on their own -- I did and still use my own -- but now I recommend that people use the "official" one.  Just today I responded to a person who was getting a memory leak because they had followed the older Netty tutorial.

 

I think in a modding support forum you have to consider the different skill levels (Java wise) of the people trying to mod.  There are people who are still missing basic Java, there are people like me who are fairly confident but still fumble some code, and there are expert.  For those first two categories, using "official" hooks is the way to go.  So when cpw finally gets SimpleNetworkWrapper going, or when they add a new event, it is worth posting as "news" to us.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • How to fix file server-1.20.1-20230612.114412-srg.jar  
    • Just a few months ago I was creating my own plugin for Minecraft 1.20.2 spigot that did the same thing, but the skins were not saved, if you can understand this code that I made a long time ago it may help you.   //This is a class method private static String APIRequest(String value, String url, String toSearch) { try { URL api = new URL(url + value); HttpURLConnection connection = (HttpURLConnection) api.openConnection(); connection.setRequestMethod("GET"); int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); StringBuilder response = new StringBuilder(); for (String responseChar; (responseChar = reader.readLine()) != null; ) response.append(responseChar); reader.close(); JSONObject responseObject = new JSONObject(response.toString()); if (!toSearch.equals("id")) return responseObject .getJSONArray("properties") .getJSONObject(0) .getString("value"); else return responseObject.getString("id"); } else { AntiGianka.ConsoleMessage(ChatColor.RED, String.format( "Could not get %s. Response code: %s", ((toSearch.equals("id")) ? "UUID" : "texture"), responseCode )); } } catch (MalformedURLException error) { AntiGianka.ConsoleMessage(ChatColor.RED, "An error occurred while trying to access the URL. Error: " + error); } catch (IOException error) { AntiGianka.ConsoleMessage(ChatColor.RED, "An error occurred while attempting to connect to the URL. Error: " + error); } return ""; } //other class method private void SkinGetter() { String uuid; String textureCoded; if ((uuid = APIRequest(args[0], "https://api.mojang.com/users/profiles/minecraft/", "id")).isEmpty() || (textureCoded = APIRequest(uuid, "https://sessionserver.mojang.com/session/minecraft/profile/", "value")).isEmpty() ) sender.sendMessage(ChatColor.RED + String.format( "An error has occurred while trying to obtain the %s player skin, please check if the name %s is spelled correctly or try again later.", args[0], args[0] ) ); else SkinSetter(textureCoded); } //other more private void SkinSetter(String textureCoded) { JSONObject profile = new JSONObject(new String(Base64.getDecoder().decode(textureCoded))); try { URL textureUrl = new URL(profile.getJSONObject("textures"). getJSONObject("SKIN"). getString("url")); if (sender instanceof Player && args.length == 1) { PlayerTextures playerTextures = ((Player) sender).getPlayerProfile().getTextures(); playerTextures.setSkin(textureUrl); ((Player) sender).getPlayerProfile().setTextures(playerTextures); if (((Player) sender).getPlayerProfile().getTextures().getSkin() != null) sender.sendMessage(((Player) sender).getPlayerProfile().getTextures().getSkin().toString()); else sender.sendMessage("Null"); sender.sendMessage("Skin changed successfully.a"); } else { } AntiGianka.ConsoleMessage(ChatColor.GREEN, "Skin command executed successfully."); } catch (MalformedURLException error) { sender.sendMessage(ChatColor.RED + String.format( "An error has occurred while trying to obtain the %s player skin, please check if the name %s is spelled correctly or try again later.", args[0], args[0] ) ); AntiGianka.ConsoleMessage(ChatColor.RED, "An error occurred while trying to access the URL. Error: " + error); } }  
    • Use /locate structure The chat should show all available structures as suggestion For the Ancient City it is /locate structure ancient_city
    • So does it work without this mod? Did you test it with other builds?
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.