Uh oh!
There was an error while loading. Please reload this page.
feat: respect world config WorldMap settings & BetterMap compatibility - #102
Merged
derrickmehaffy merged 22 commits intoMar 15, 2026
Merged
Conversation
WorldMapService now captures each world's original WorldMapSettings before replacing the generator, creates per-world HyperFactionsWorldMap instances with those settings, and skips registration for worlds with map disabled in their world config (Issue #96). Generator re-registration on refresh reuses stored instances to preserve original settings.
viewRadiusMultiplier, viewRadiusMin, viewRadiusMax are private fields with no public getters in WorldMapSettings. Use reflection with safe fallback defaults to read them during settings inheritance.
…ig value - Add getSettingsPacket() null check in getWorldMapSettings() to prevent NPE if a world has non-null WorldMapSettings with a null packet - Validate and normalize betterMapCompat config value (auto/always/never) with warning on invalid input - Log effective BetterMap compat mode at startup for debuggability
UpdateWorldMapSettings.enabled defaults to false (Java boolean default), so even normal WorldGen worlds appear disabled when checking packet.enabled. Only use identity equality with the DISABLED singleton to detect truly disabled worlds.
WorldMapManager generators are initialized AFTER plugin enable during 'Getting Hytale Universe ready'. Schedule delayed registration (60 ticks) so we can capture original settings from the fully-initialized manager. Set WorldConfig provider early so the server uses it during init.
Vanilla UpdateWorldMapSettings has 0.0f for defaultScale/minScale/maxScale (Java float default) — the server never sets these because the client handles zoom independently. Inheriting zeros causes a tiny low-quality map view. Fall back to 128/64/128 when inherited values are zero.
…t first Setting our provider before the server initializes WorldMapManager caused the server to use HyperFactionsWorldMap during init, so the delayed registration captured our own hardcoded settings instead of the vanilla GeneratorChunkWorldMap values (imageScale, viewRadius, scale bounds). Now we only register via the delayed task, which runs AFTER the server initializes with the vanilla generator, allowing us to capture the original high-quality settings before replacing.
Expose scale overrides (defaultScale, minScale, maxScale, imageScale) and allow* flag overrides in the admin config GUI. Scale values use 0 = inherit from world. Boolean flags use inherit/enabled/disabled dropdowns.
Add WorldMapService.reapplySettings() that re-creates per-world generators with current config overrides, installs them on the WorldMapManager, and sends UpdateWorldMapSettings packets to all connected players. Called from reloadRuntimeSystems() after admin GUI config save so changes take effect without server restart.
…ibility MapPlayerFilterService now uses BOTH mechanisms for player visibility: 1. setPlayerMapFilter() — for vanilla OtherPlayersMarkerProvider (deprecated) 2. HiddenPlayersManager.hidePlayer/showPlayer — for BetterMap's PlayerRadarProvider Tracks which viewer→target pairs we hid to avoid accidentally unhiding players hidden by other systems (admin /hide command, other mods). Faction visibility rules (own/ally/enemy/neutral/factionless) are applied through both layers for complete coverage.
This was referenced Mar 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WorldMapSettingsbefore replacing the generator. Disabled worlds ("WorldMap": { "Type": "Disabled" }) are skipped entirely. All settings (scale, allow* flags, imageScale, viewRadius, biomeData) are inherited from the world config instead of being hardcoded.Class.forName). When active, defersimageScaleto BetterMap's quality system and inherits world settings that BetterMap can then modify via its reflection hooks. No compile-time dependency on BetterMap.settingsOverridessection inworldmap.jsonallows admins to override specific inherited values (scale, teleport flags, marker creation).nullor absent = inherit from world. Exposed in admin GUI with0 = inheritfor scale values andinherit/enabled/disableddropdowns for flags.WorldMapService.registerProviderIfNeeded().setPlayerMapFilter()(vanilla icons, deprecated API) ANDHiddenPlayersManager.hidePlayer()/showPlayer()(BetterMap radar + future-proof). Tracks ownership of hidden pairs to avoid conflicts with other mods.UpdateWorldMapSettingspackets to all connected players — no restart needed.ErrorHandler.report().PlayerPowerTestandMockStorageforPlayerPowerrecord andPlayerStorageinterface changes.Key Changes
worldmap/HyperFactionsWorldMap.javaworldmap/WorldMapService.javareapplySettings()for live config updatesworldmap/BetterMapCompat.javaworldmap/HyperFactionsWorldMapProvider.javaworldmap/MapPlayerFilterService.javasetPlayerMapFilter+HiddenPlayersManagerwith ownership trackingconfig/modules/WorldMapConfig.javaconfig/ModuleConfig.javagetOptionalFloat()/getOptionalBool()nullable helpersplatform/WorldSetup.javagui/admin/page/AdminConfigPage.javagui/admin/ConfigSnapshot.javagui/admin/ConfigValidator.javaHyperFactions.javareapplySettings()on config savemanifest.jsondev.ninesliced:BetterMap >= 1.3.3as OptionalDependencyConfig Example
{ "respectWorldConfig": true, "betterMapCompat": "auto", "settingsOverrides": { "_description": "Override inherited world settings. Remove a key or set to null to inherit.", "defaultScale": null, "minScale": null, "maxScale": null, "imageScale": null, "allowTeleportToCoordinates": null, "allowTeleportToMarkers": null, "allowCreatingMapMarkers": null } }Known Limitations
hideAllPoiOnMap: truein BetterMap config. Proper fix requires BetterMap's planned Mod API (trello).Test Plan
"WorldMap": { "Type": "Disabled" }→ HyperFactions skips registration, no claim overlay"WorldMap": { "Type": "WorldGen" }→ inherits scale/flag values from worldrespectWorldConfig: false→ legacy behavior (hardcoded values)/f admin map refreshworks after changesCloses#96, Closes#97