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.

segmentationfault

Members
  • Joined

  • Last visited

  1. Turns out that category names must be lowercase, the issue was fixed by changing public static final String CATEGORY_FARMING = "Farming"; to public static final String CATEGORY_FARMING = "farming";
  2. Working on a mod that needs a complex config for the user to set up, but only the "general" category shows up (from Configuration.CATEGORY_GENERAL). This is how stuff's being registered: public class ModGUIConfig extends GuiConfig { public ModGUIConfig(GuiScreen guiScreen) { super(guiScreen, ConfigurationHandler.getConfigElements(), Reference.MOD_ID, true, true, GuiConfig.getAbridgedConfigPath(ConfigurationHandler.getConfiguration().toString())); } } public class ConfigurationHandler { public static void init(String configDir) { if(configDir != null) { File path = new File(configDir + "/" + Reference.MOD_ID + ".cfg"); configuration = new Configuration(path); loadConfiguration(); }else{ configDir = "/config"; } } public static int crop_workers = 1; public static String seed_supplier = "greenthumb"; public static String storage_barn = "MacDonalds"; public static boolean serverFeatures = false; public static String commandOnHarvest = ""; public static final String CATEGORY_FARMING = "Farming"; private static void loadConfiguration() { crop_workers = configuration.getInt("Farm Workers", CATEGORY_FARMING, 1, 1, 2048, "How many workers should tend to your crops. Should be kept low to preserve game performance. " + "[default: 1, min: 1, max: 2048]"); seed_supplier = configuration.getString("Seed Supplier", CATEGORY_FARMING, "greenthumb", "Which seed supplier to connect get seeds from" ); storage_barn = configuration.getString("Storage Barn", CATEGORY_FARMING, "MacDonalds", "Your crop storage barn"); serverFeatures = configuration.getBoolean("Server Features", Configuration.CATEGORY_GENERAL, false, "Whether or not you want the server-side features of this mod, such as:" + "\n Allowing players to trade crops in-game" + "\n Allowing servers to execute commands in exchange for crops" + "\n Allowing servers to execute a command every time crops are harvested on the farm that the server is connected to"); commandOnHarvest = configuration.getString("Command on farm harvest", Configuration.CATEGORY_GENERAL, "", "Command to execute when crops are successfully harvested on the farm that the SERVER is connected to" + "\n This command will execute ANY TIME crops are harvested from the farm, meaning that this can go off constantly if you're using a popular supplier"); if(configuration.hasChanged()){ configuration.save(); } } public static List<IConfigElement> getConfigElements() { loadConfiguration(); ArrayList<IConfigElement> iConfigElements = new ArrayList<IConfigElement>(); iConfigElements.add(new ConfigElement(ConfigurationHandler.getConfiguration().getCategory(ConfigurationHandler.CATEGORY_FARMING))); iConfigElements.add(new ConfigElement(ConfigurationHandler.getConfiguration().getCategory(Configuration.CATEGORY_GENERAL))); //System.out.println(""+iConfigElements.toString()); return iConfigElements; } } The GUI is built, but the "Farming" category is empty, having no options in it

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.