OneConfig V1
  • Welcome
  • Documentation license
  • Introduction
    • Getting started
  • Configuration
    • Creating your config
      • Option dependencies & hiding options
      • Listening for option changes
    • Available options
      • Boolean options
        • Switch option
        • Checkbox option
      • Number options
        • Slider option
        • Number option
      • Selector options
        • Dropdown option
        • Radio button option
      • Text option
      • Color option
      • Keybind option
      • Buttons
      • Accordions
      • Decorations
    • Creating your own options
  • Commands
    • Annotation-based commands
    • Tree-based commands
  • Events
    • Using the events system
      • Callback events
      • Subscriber events
  • Utilities Module
    • Hypixel utilities
    • IO utilities
    • Networking utilities
    • JSON utilities
    • Multithreading
    • Platform-specific utilities
  • Migration
    • Temporary V0 -> V1 migration guide
    • Migrating your configs from Vigilance
Powered by GitBook
On this page
  • Get it working in Gradle
  • Notable changes
  • New
  • Package changes
  • Class name changes
  • Misc
  • Examples
Export as PDF
  1. Migration

Temporary V0 -> V1 migration guide

PreviousPlatform-specific utilitiesNextMigrating your configs from Vigilance

Last updated 5 months ago

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.

cc.polyfrost -> org.polyfrost
cc.polyfrost.libs.universal -> org.polyfrost.universal
cc.polyfrost.oneconfig.events -> org.polyfrost.oneconfig.api.event.v1.events
cc.polyfrost.oneconfig.platform -> org.polyfrost.oneconfig.api.platform.v1
cc.polyfrost.oneconfig.utils -> org.polyfrost.oneconfig.utils.v1
cc.polyfrost.oneconfig.utils (for Notifications class) -> org.polyfrost.oneconfig.api.ui.v1
cc.polyfrost.oneconfig.utils.hypixel -> org.polyfrost.oneconfig.api.hypixel.v0
cc.polyfrost.oneconfig.utils.commands -> org.polyfrost.oneconfig.api.commands.v1
cc.polyfrost.oneconfig.utils.commands.annotations -> org.polyfrost.oneconfig.api.commands.v1.factories.annotated
cc.polyfrost.oneconfig.config -> org.polyfrost.oneconfig.api.config.v1

Class name changes

@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

Examples

- CrashPatch [V1 DONE]
- PolyBlur [V1 DONE]
- ColorSaturation [V1 DONE]
- OverflowAnimations [V1 DONE]
- GlintColorizer [V1 DONE]
- PolyPatcher [V1 DONE]
- REDACTION [V1 DONE]
- PolySprint [V1 DONE]
- BehindYouV3 [V1 ½ done]
- PolyCrosshair [V1 __not__ done]
- OverflowParticles [V1 __not__ done]

- EvergreenHUD [V1 ½ done]
- PolyHitbox [V1 __not__ done]
- VanillaHUD [V1 ½ DONE]
- Chatting [V1 __not__ done]
- Keystrokes Reborn [V1 __not__ done]

- PolyNametag [V1 DONE]

- DamageTint [V1 DONE]
- Hytils Reborn [V1 DONE]

- PolyTime [V1 DONE]
- PolyWeather [V1 DONE]

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:

Getting Started
PLEASE contribute to this guide
CrashPatch
EvergreenHUD
Hytils Reborn
PLEASE contribute to this guide