Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I made a very simple @Config class with just a few booleans:

Spoiler

@Config(modid = Geomastery.MODID)
public class GeoConfig {

    @Comment("Show the food type in the item tooltip")
    public static boolean foodTooltips = true;

    @Comment("Show the item's decay level with the filled proportion of durability bar as well as colour")
    public static boolean foodDurability = false;

    @Comment("Show the biomes where a crop can grow in the item tooltip")
    public static boolean cropBiomes = true;

    @Comment("Hide unusued and inaccessible vanilla items from Just Enough Items")
    public static boolean hideVanilla = true;
    
    @Comment("Show simple building block requirements in the item tooltip")
    public static boolean buildReqs = true;
}

 

When I delete the config file, it creates it with the properties and comments in the class, and when I change values in the file then the fields in the class change as expected - so it's definitely working in some sense. But the "config" button in the mods list is greyed out. There aren't any crashes or error messages that I can find, but I could post the whole log if that's useful.

 

I do subscribe to OnConfigChangedEvent in my mod class, but it doesn't get called because there is no GUI to save the config from.

Spoiler

    @SubscribeEvent
    public static void configChanged(ConfigChangedEvent.OnConfigChangedEvent
            event) {

        if (event.getModID().equals(MODID)) {

            ConfigManager.load(MODID, Config.Type.INSTANCE);
        }
    }

 

 

What am I missing? All my code is on github.

Forge doesn't automatically create a config GUI for you. In your @Mod annotation, you need to provide a value for the guiFactory property. It should be the fully-qualified name of a class that implements IModGuiFactory. In your GUI factory, you'll need to make sure that hasConfigGui returns true and that you've implemented createConfigGui.

 

This is my GUIConfig class which is a small wrapper around FML's GuiConfig class that makes it a bit easier to use. 

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Forge does automatically create a config GUI for you if you're using the annotation-based config system and Forge 1.11.2-13.20.0.2262 (commit 25497d3) or later.

 

You're using Forge 1.11.2-13.20.0.2228, so you need to update to get the automatic config GUI.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.