[genData] "Empty" Files
Closed this issue ยท 7 comments
Describe the solution you'd like
When running genData withDefaults
with existing data files, each file be checked to see if it has no data (could maybe template an empty file and check hashes?) and overwritten if it contains no data.
Why is this feature needed
To make datapack generation more intuitive.
Describe alternatives you've considered
Sleeping. Oh Grod, more sleep would be good.
Additional context
Goober_1.mp4
Oh, it would probably need to check two hashes, one for each possible value of "override":
The intention of withDefaults
is not simply to clone the existing datapacks/autovalues, but to create all entries with the defaults layered in. My concern with altering this behavior is that players will see only files that have data generated and think that's the only thing that can be configured. Whereas what they typically want is to configure the mod, but not from scratch.
This was mostly to cover folks who generated a pack, added some values to a few things, but then wanted to get the defaults for everything else.
they'll still have the defaults. with or without overrides, the empty files are discarded on load by the filereader and the non-empty ones have the same setting so it won't matter.
Okay, because right now, files with blank datastructures are not discarded.
If I generate a pack with:
/pmmo genData begin
/pmmo genData create
It makes a datapack with all the files and empty structures.
If I then:
/pmmo genData begin
/pmmo genData withDefaults
/pmmo genData create
It doesn't populate any of the files with their defaults.
This mainly becomes an issue when someone generates a pack withConfigs
and then wants to generate a withDefaults
pack.