OneConfig V1 is now available to all developers, with some conditions:
Not everything has been documented just yet...
Currently, V1 will not work on modern versions due to an issue with LWJGL natives. But it compiles!
Expect bugs with OneConfig V1 itself.
This is in NO WAY a complete guide as of yet. if you find any discrepancies.
Below are screenshots of the new GUI. Yes, these are concept designs, but it's basically been implemented 1:1 and I'm way too lazy to take actual screenshots lol
Get it working in Gradle
Notable changes
New
Now split into multiple, non-Minecraft dependant modules, and one Minecraft module
Uses PolyUI
- Extremely optimized UI lib, using NanoVG
- "Render what you need ONLY WHEN you need it"
- Performance boost as a result of this
- As a result, theming support is automatic and will be implemented soon
Official support for Legacy Fabric and modern MC (Forge, Fabric, and soon NeoForge)
Commands can now be created via `CommandBuilder`, a Brigadier-style builder.
Complete rewrite of config system
-https://github.com/Polyfrost/OneConfig/tree/v1/modules/config#oneconfig-config
- Now supports more than just registering config values via annotations
Complete rewrite of HUD system
- Using PolyUI
- Separate from configs now
- Supports multiple of a HUD
- https://github.com/Polyfrost/OneConfig/tree/v1/modules/hud#oneconfig-hud
- As explained, you can use `LegacyHud` to just render like in V0. But we STRONGLY recommend using the new PolyUI-based APIs
Keybind rewrite
Package changes
You should be able to do a find and replace with import <old package name> . Go in opposite order from this list if you want to do a full search and replace.
@Main and @SubCommand -> @Command
@Description -> @Parameter
@Greedy -> `greedy` field in @Command annotation
OneColor -> PolyColor
@VigilanceName (or any other migrator name -> @PreviousName (check javadocs for new syntax)
new OneColor(value) -> ColorUtils.rgba(value)
NetworkUtils.getJsonElement -> JsonUtils.parseFromUrl
JsonUtils.parseString -> `parse` or `parseOrNull`
EventManager.register notes:
- We strongly recommend devs to switch from annotation-based event registering to the new system.
- EventManager.register(EventName.class, (event) -> { doStuff(); });
- In Kotlin you can do eventHandler { event: EventName -> { doStuff() } }.register()
- If for whatever reason you cannot, keep the following in mind:
- Registered objects to the EventManager are now not removable by default. To allow it to be removed, call `register(new ClassName(), true)`
TickDelay -> EventDelay.ticks
RenderTickDelay -> EventDelay.render
Misc
new VigilanceMigrator (or any other migrator) -> `loadFrom` method in config.
CommandManager.INSTANCE.registerCommand -> CommandManager.registerCommand
CommandManager.INSTANCE.addParser -> CommandManager.INSTANCE.registerParser
@Command `aliases` field -> `value`
- it is now an array, you pass the main one as the first and the rest as aliases
Notifications.INSTANCE.send -> NotificationsManager.INSTANCE.enqueue
- You now need to provide a notification "type"
- We'll probably rename the class back to Notifications depending on how things go
Multithreading.runAsync -> Multithreading.submit
ConfigUtils.getProfileFile -> ConfigManager.active().getFolder().resolve
- Returns a Path instead of a File
HypixelUtils.INSTANCE -> HypixelUtils
- Locraw Util is completely removed, instead we now provide a Hypixel Mod API-based API in HypixelUtils
ArgumentParser.complete -> getAutoCompletions
- It is now nullable, so pass `null` instead of an empty list
- For config annotations, the `name` field is now `title`
- For config annotations, `size` is removed. All config options are "size 2"
- **VERY IMPORTANT** - variables in configs are NOT serialized by default anymore. Instead of @Exclude-ing variables you don't want, you need to @Include variable you DO want and not annotate the others.
- new VigilanceMigrator (or any other migrator) -> `loadFrom` method in config.
- @VigilanceName (or any other migrator name -> @PreviousName (check javadocs for new syntax)
- `initialize` method is no longer necessary.
- addListener -> addCallback
All the ported versions should be in the "twoconfig" branch (EXCEPT EvergreenHUD, that work is in the "rewrite" branch).
Please follow the guide for this.
This is in NO WAY a complete guide as of yet. if you find any discrepancies.
We recommend checking out our mods, which have somewhat already been ported to V1 (59%). Good examples are , , and . Here is a periodically updated list of our ported mods: