BetterConfig

BetterConfig

Mod and plugin

A very powerful and easy to use command based configuration library for servers and clients.

Client or server LibraryManagementStorage

3,386 downloads
7 followers
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!
Filter loader...
Filter versions...
  • Added the sources JAR to the publication
  • Fixed a bug with ModConfig#resetTemporaryConfigs that could cause a bug when a config is both temporary and readOnly

This release introduces two new features and some bug fixes!

  • Added the onChange config attribute (#10). You can now register a function that is called whenever a specific config is updated. For example:
    @Config(onChange = "onChange")
    public static List<String> exampleOnChange = new ArrayList<>(List.of("xpple, earthcomputer"));
    private static void onChange(List<String> oldValue, List<String> newValue) {
        LOGGER.info("exampleOnChange was updated | old: {}, new: {}", oldValue, newValue);
    }
    
  • Added global change hook (#11). This allows you to register a global function that is called whenever any config is updated. For example:
    new ModConfigBuilder<>("<mod id>", Configs.class)
        .registerGlobalChangeHook(event -> BetterConfigCommon.LOGGER.info("{} was updated | old: {}, new: {}", event.config(), event.oldValue(), event.newValue()))
        .build();
    
  • Added Tatar translations (#8 by Amirhan-Taipovjan-Greatest-I)
  • Added support for Paper servers Depending on your setup, you might have to adjust how the config is initialised:
    • Fabric clients:
      new ModConfigBuilder<FabricClientCommandSource, CommandBuildContext>(<mod id>, Configs.class)
          // ...
          .build();
      
    • Fabric servers:
      new ModConfigBuilder<CommandSourceStack, CommandBuildContext>(<mod id>, Configs.class)
          // ...
          .build();
      
    • Paper servers:
      new ModConfigBuilder<>(<plugin name>, Configs.class)
          // ...
          .build();
      
  • Added support for server-sided custom argument types
    • Fabric:
      dev.xpple.betterconfig.util.WrappedArgumentType
      
    • Paper:
      io.papermc.paper.command.brigadier.argument.CustomArgumentType
      
  • Fixed bug where the reset subcommand would be available for readonly configs
  • Added support for Paper servers (details will follow in the stable release)

Release 1.3

by xpple on Jun 17, 2024
Download
  • Updated to Minecraft 1.21
  • Fixed resetting some configs by using deep copied value

Release 1.2.1

by xpple on Aug 24, 2023
Download
  • Added boolean argument type back to default arguments

Release 1.2.0

by xpple on Aug 23, 2023
Download
  • Made non-api packages no longer visible

  • Rewrote argument registration

    Consider the below example to see how things have changed.

    - .registerTypeWithArgument(Block.class, new BlockAdapter(), new Pair<>(BlockArgumentType::block, BlockArgumentType::getBlock))
    + .registerType(Block.class, new BlockAdapter(), BlockArgumentType::block)
    

Release 1.1.7

by xpple on Aug 19, 2023
Download
  • Fixed enum parsing when enum overrides toString
  • Prioritised custom arguments/suggestors over enum check
  • Fixed crashing on startup when the config is corrupted

Release 1.1.6

by xpple on Aug 19, 2023
Download
  • Added comments
  • Prevented getting a config being broadcasted on servers
  • Fixed keys being improperly printed when putting to a map

Release 1.1.5

by xpple on Jul 11, 2023
Download
  • Changed string type to greedy phrase for suggestor based argument types
  • Fixed config directory not being created on initialisation

Release 1.1.4

by xpple on Jul 9, 2023
Download
  • Disallowed final fields reasons
  • Allowed custom updaters to be private
  • Provided (English) fallback translations for servers

Release 1.1.3

by xpple on Jul 5, 2023
Download
  • Fixed config not saving after resetting

Release 1.1.2

by xpple on Jun 26, 2023
Download
  • Made sure config is always saved after first read

Release 1.1.1

by xpple on Jun 7, 2023
Download
  • Added conditions

Project members

xpple

Owner

Details

Licensed LGPL-3.0-or-later
Published 2 years ago
Updated a month ago