-
-
Notifications
You must be signed in to change notification settings - Fork 780
Switch config system to Configurate #5010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ure/configurate
…ure/configurate
…ure/configurate
…ure/configurate
Improve node ordering when updating configs
core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java
Outdated
Show resolved
Hide resolved
…#5964) * Add automatic downloading of the GeyserOptionalPack * Warn about including the OptionalPack from extensions when Geyser is already including it instead of throwing. * Copy optional pack instead of downloading --------- Co-authored-by: onebeastchris <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request migrates Geyser's JSON processing and configuration management from Jackson/custom YAML to Gson and Spongepowered Configurate. The changes include:
- Replacement of Jackson dependency with Gson for JSON serialization/deserialization
- Migration to Spongepowered Configurate for YAML configuration handling
- Updates to all JSON processing code throughout the codebase
- Addition of comprehensive test fixtures for configuration migration testing
- Refactoring of configuration interfaces to use record-style accessor methods
Reviewed Changes
Copilot reviewed 147 out of 148 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/libs.versions.toml | Updated dependencies: removed Jackson, added Gson 2.10.1, Configurate 4.2.0, and related libraries |
| core/src/test/resources/configuration/* | Added test fixtures for configuration loading and migration testing (legacy, default, invalid, all-changed scenarios) |
| core/src/test/java/.../ConfigLoaderTest.java | New comprehensive test suite for configuration loading and migration |
| core/src/test/java/.../GeyserMockContext.java | Updated mock configuration to use new config interface methods |
| core/src/main/java/.../util/* | Migrated WebUtils, VersionCheckUtils, FileUtils, AssetUtils from Jackson to Gson |
| core/src/main/java/.../util/metrics/* | New metrics platform abstraction replacing old Metrics class |
| core/src/main/java/.../text/* | Updated locale and serialization code to use Gson |
| core/src/main/java/.../skin/* | Migrated skin provider and manager from Jackson to Gson |
| core/src/main/java/.../session/* | Updated session classes to use new config accessor methods |
| core/src/main/java/.../translator/* | Updated translators to use new config method signatures |
| core/src/main/java/.../registry/* | Migrated registry populators and mappings readers to Gson |
Comments suppressed due to low confidence (1)
core/src/main/java/org/geysermc/geyser/event/type/SessionLoadResourcePacksEventImpl.java:65
- This method overrides GeyserIntegratedPackUtil.getPacks; it is advisable to add an Override annotation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/org/geysermc/geyser/registry/loader/SoundRegistryLoader.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/configuration/ConfigLoader.java
Outdated
Show resolved
Hide resolved
| if (!IP_REGEX.matcher(remoteAddress).matches() && !remoteAddress.equalsIgnoreCase("localhost")) { | ||
| String[] record = WebUtils.findSrvRecord(this, remoteAddress); | ||
| if (record != null) { | ||
| int remotePort = Integer.parseInt(record[2]); |
Copilot
AI
Nov 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential uncaught 'java.lang.NumberFormatException'.
core/src/main/java/org/geysermc/geyser/pack/GeyserResourcePackManifest.java
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/event/type/GeyserDefineResourcePacksEventImpl.java
Show resolved
Hide resolved
…the logger at that stage
…m the "packs" folder, add another legacy config test
This reverts commit fbadfa5.
# Conflicts: # core/src/main/java/org/geysermc/geyser/GeyserImpl.java # core/src/main/java/org/geysermc/geyser/session/GeyserSession.java # core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java
…ne command locking issues
* Start implementing Configurate config system * More development * Start migrating to Gson only * Progress * Update usage of WebUtils * Most things now use Gson for JSON * Allow tests to succeed by using new Gson version * Use slightly cleaner version for Version deserializer * Work around older Gson versions without record support * GeyserCustomSkullConfiguration uses Configurate * Fix regression in properties get * New config used in core * The configuration is gone. Long live the config. * More changes and migrations away from Jackson * Improve node ordering when updating configs * typo * Better check for ignoring non-configurate configs for considering comment moving * Ensure metrics UUID is valid * Initial advanced config * Remove Jackson; finish config value placements * Remove duplicate relocate declarations * Let annotations work * Renaming to PluginSpecific * Use global bStats config where possible * Fix test * Re-introduce asterisk behavior in configs * Remove GeyserPluginBootstrap as it's no longer necessary * Remove old config.yml file * Update Xbox achievement comment * Apply suggestions from code review Co-authored-by: chris <[email protected]> * No need to remove values anymore * Fix: disable bstats relocation on platforms where it is not needed * ensure it builds * Update custom unavailable slot comment Co-authored-by: chris <[email protected]> * Update cooldown image * Logger message for direct-compression still being enabled * oops * More explicit RuntimeException message Co-authored-by: Konicai <[email protected]> * Constant for 'system' locale * Better config JSON encoding (something is broken with Cloudflare; we'll figure it out * Fix broadcast port default * Add this file too * Update configurate branch * fix build * Fix: Allow using custom config file on Standalone, add relocation comment * Move config loading to GeyserBootstrap interface * Add and rename some config options, add section notes (GeyserMC#5390) * Add and rename some config options, add section notes * adjust message * Update core/src/main/java/org/geysermc/geyser/command/defaults/ConnectionTestCommand.java Co-authored-by: Eclipse <[email protected]> * Update core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java Co-authored-by: Eclipse <[email protected]> * Update ConfigLoader.java * Update AdvancedConfig.java * clarify that we're talking about the HAProxy protocol * rename config option to use-haproxy-protocol * remove ominous warning sign on xbox auth warning * adjust wording --------- Co-authored-by: Eclipse <[email protected]> * Back to one config file * Some minor touchups * Configurate: Sectionification (GeyserMC#5904) * Init: config sections * Start on adding tests, move migrations over to ConfigMigrations class * Get rid of auth section again, rename that one config option, fix mtu migration * Move custom skulls config options to the bottom of the gameplay settings * Add more tests * Rename and migrate proxy-protocol-whitelisted-ips to haproxy-protocol-whitelisted-ips * Add automatic downloading of the GeyserOptionalPack * Revert "Add automatic downloading of the GeyserOptionalPack" This reverts commit 65b9620. * Add more invalid config tests * Warn about emote-offhand-workaround removal * Add automatic loading of the GeyserOptionalPack (feature/configurate) (GeyserMC#5964) * Add automatic downloading of the GeyserOptionalPack * Warn about including the OptionalPack from extensions when Geyser is already including it instead of throwing. * Copy optional pack instead of downloading --------- Co-authored-by: onebeastchris <[email protected]> * Remove unused variable * Start warning users not running Java 21 * Update tests, temporarily remove NumericRanges test * Remove duplicate advanced section from Geyser dump * Address some "reviews" * yeet md5 hash from geyser dump * Add info about number of resource packs / amount of mappings into Geyser dump * Re-enable invalid config loading test * Fix: allow-custom-skulls migration * Fix test * Add "enable-emotes" configuration option * Rename "emotes-enabled" to "show-emotes" * Only enable integrated pack when optional pack isn't present * Update integrated pack * Exclude jackson annotations, remove leftover debug print * Remove one-time config migration warnings as we don't have access to the logger at that stage * Throw more detailed descriptive error when loading resource packs from the "packs" folder, add another legacy config test * Fix NeoForge's fun module conflict * Re-add warning about moved functionality, fix Geyser-ViaProxy This reverts commit fbadfa5. * oops * Move GeyserLegacyPingPassthrough to separate thread to avoid Standalone command locking issues --------- Co-authored-by: Konicai <[email protected]> Co-authored-by: chris <[email protected]> Co-authored-by: Eclipse <[email protected]> Co-authored-by: Aurora <[email protected]>
The primary goal of this PR is to facilitate config changes required for the Floodgate merge, while also allowing for automatic config file generation and updates, as well as customizing configs depending on the features available to a platform.
We have also decided to remove usage of the Jackson library within Geyser. While it has its benefits over Gson, ultimately all platforms have Gson access (and our libraries utilize Gson alongside that) and Jackson is a hefty dependency to shade within Geyser.
User-facing Configuration Changes
This update introduces a major refactor of the Geyser configuration file to improve clarity and organization. Your existing configuration will be automatically migrated.
Main Changes:
java,bedrock,motd,gameplay, andadvanced.Removals
allow-custom-skulls: This option has been removed. To disable custom skulls, setgameplay.max-visible-custom-skullsto0.emote-offhand-workaround: This workaround has split into two things:show-emotes: A config option in the "gameplay" section whether emotes should be shown to other Bedrock playersEmoteOffhand: a small Geyser extension to switch items when emoting. This can be downloaded on our downloads page or its modrinth page.remote.address: auto: Theautovalue is no longer used. On standalone, it will be converted to127.0.0.1. On plugin versions, thejava.addressandjava.portoptions are removed entirely as they are auto-detected.legacy-ping-passthrough(Standalone): This option was non-functional on Geyser-Standalone and has been removed there; on other platforms it is now inverted and calledintegrated-ping-passthrough.Renames & Moves
Many options have been renamed or moved into new sections. Here is a summary of the most notable changes:
remotesection -> Renamed tojava.bedrocksection -> Many options moved out:motd1/motd2->motd.primary-motd/motd.secondary-motd.server-name->gameplay.server-name.broadcast-port,compression-level, etc. ->advanced.bedrocksection.motdsection (New): Now contains all MOTD and ping-related settings.passthrough-motd,passthrough-player-counts,ping-passthrough-interval,max-playersare now here.legacy-ping-passthrough-> Renamed tointegrated-ping-passthroughand its boolean value is now invertedgameplaysection (New): Contains most options that affect the player experience.command-suggestions,show-coordinates,forward-player-ping, etc. are now here.add-non-bedrock-items-> Renamed toenable-custom-content.above-bedrock-nether-building-> Renamed tonether-roof-workaround.advancedsection (New): Contains settings for advanced users and specific use cases.cache-images,scoreboard-packet-threshold,floodgate-key-file, etc. are now here.bedrock.enable-proxy-protocol->advanced.bedrock.use-haproxy-protocol.bedrock.proxy-protocol-whitelisted-ips->advanced.bedrock.haproxy-protocol-whitelisted-ipsremote.use-proxy-protocol->advanced.java.use-haproxy-protocol.Additions
gameplay.enable-integrated-pack: Whentrue, Geyser will automatically serve the now integrated GeyserOptionalPack, which provides visual fixes and Java-parity features for Bedrock clients.gameplay.show-emotes: Whether to broadcast Bedrock Edition emotes to all other Bedrock edition players.advanced.resource-pack-urls: Allows loading remote resource packs. Bedrock is very picky about these, hence why it's an advanced option.Further, the
metricssection has been removed on platforms that natively support metrics to respect platform-wide configuration. On platforms where it isn't supported,metrics/uuidis nowmetrics-uuid, andmetrics/enabledis nowenable-metrics.The config file is split into two files -This will be done at a later date.config.ymlandconfig-advanced.yml(name subject to change to something that will always place it belowconfig.ymlalphabetically). The primary config will consist of values that a typical user needs to change for a typical setup or other basic config values. The advanced config will consist of values that we don't want most users to change, while still being accessible to tech-savvy users.The ultimate goal is to keep setup super-simple while still allowing Geyser to be customizable.
Metrics config options are now moved to platform global configs, if they currently exist.