Resourceful Config

Resourceful Config

73M Downloads

[Feature Request]: @SyncedConfigEntry annotation

CammiePone opened this issue ยท 1 comments

commented

Is your feature request related to a problem?

Sometimes you need a config option controlled by the server, but only affects things on the client.

Two examples from my own mods:

  • flight speed in Icarus, which is handled solely client-side for a smooth experience
  • Arcanus' casting delay, which just determines if there's a cool down between selecting patterns for casting

Both of these can be changed on the client, and without any checks from the server, would allow a player to gain an advantage over other players.

Solution(s)

I think an annotation that ensures those config entries are always synced between client and server would be a good addition to the mod, as it could gray out the config options in the config screen to indicate to a player that only the server can modify those entries, and it makes it easier for modders to ensure players won't be able to get an advantage over other players on a server via config changes.

I know I'm on an outdated version at the moment, but having this in a future version would be amazing regardless.

Describe alternatives you've considered

The only alternative I've found so far is keeping static variables for certain config options in the mod's client initializer that get set whenever a player joins a server, which works but means indirectly accessing the config options when in multiplayer and directly accessing the config options when in singleplayer. Otherwise singleplayer users wouldn't be able to change a config option and have it take affect without reloading their world.

Mod Version

3.0.11

Mod Loader Version

1.21.1 - 0.16.13

Mod Loader

Fabric

Additional context

There is at least one other mod of mine that would benefit from this called Firework Frenzy, and I'm sure there's other mods out there that would as well. Beyond my own mods though, it would also make it so tooltips defined by configs are always accurate for every player.

commented

Ive thought about adding this before, my route was going to be something similar to Observables which would be Syncable. Currently also an alternative to what you have and the issue you ran into with updating such value is that you can use Observables to listen for when its updated and update the cache.