FabricMC / fabric

Essential hooks for modding with Fabric.
Apache License 2.0
2.33k stars 408 forks source link

Server Configs, Client Options, and Instance Properties (An argument for why configs should be in Fabric API) #130

Open Prospector opened 5 years ago

Prospector commented 5 years ago

The proposal:

Why configs and options should be in Fabric API:

asiekierka commented 5 years ago

Configs are part of data packs, fabric loader doesn't load resources or anything like that

Data packs are only a 1.13+ construct, and. I think Loader absolutely should be the authority for at the very least parsing configuration files and providing basic load/save facilities, leaving datapack support, synchronization and more high-level path wrapping to the API.

Prospector commented 5 years ago

Sure, the parsing and format I guess could be in loader

LemmaEOF commented 5 years ago

I’m just finished with my surgery but when I’m ready to program again I’m gonna generify the stuff so you can pass any parent dir instead of FabricLoadee.getInstance().getConfigDirectory() do you can have config in datapacks too

LemmaEOF commented 5 years ago

I also feel like config in datapacks shoulsn’t include requires-restart options, for obvious reasons. I’ll sketch a ResourceReloadListener thing for datapack config-loading when I’m ready.

Prospector commented 5 years ago

Well my point is that there should be a separate system for instance level properties

LemmaEOF commented 5 years ago

you mentioned in the server the concept of using gamerules, but i dunno how well that'd work without a big rework of the gamerule system.

Prospector commented 5 years ago

yeah and then you'd have a set of configs that are per world but separate from data packs and it would be a mess

LemmaEOF commented 5 years ago

honestly, the best thing we could do would be to just put config files in datapacks and have ResourceReloadListener to apply them.

Prospector commented 5 years ago

I think it's important that we keep the terminology among a config, option, and property distinct or else it'll get super confusing for the users. "Why are my configs in 3 different places?"

LemmaEOF commented 5 years ago

what would you define each as?

Prospector commented 5 years ago

that was the whole first part of this issue

LemmaEOF commented 5 years ago

ahh, forgot that.

LemmaEOF commented 5 years ago

I've made a bit of abstraction in the PR so that you can choose where to get the config file from. Using this with a ResourceReload Listener will make it so you can search through data packs for a config directory. I'd have to make something special for datapack-searching, though, because not every datapack is gonna have the configs for all mods.