Veinminer groups not saved on server restart or being respected on use
MC Server: 1.21
Fabric: 0.15.11
Veinminer: 2.0.7
Hello!
Recently updated to the latest fabric Veinminer for the grouping functionality. When I configure groups separating the ores, the groups are not saved to the \config\Veinminer\groups.json. Additionally, the groups aren't being respected (if someone mines a coal ore, which happens to be next to another ore, both ores break). I'm unsure if this is the expected outcome, or if to get it to solely follow the group configs the "blocks" would need to be removed from their list.
Thanks for any help!
29 Replies
Veinminer has by default one group for all ores to make it possible to mine all ores at the same time, the ores not being saved is something I'm gonna investigate
Are you using Paper or fabric?
Our server is on Fabric. Is there a way to disable the default group and override it with the custom groups?
you can
/veinminer groups remove Ores
to remove the default ore groupGotcha! I wasn't sure if that would break anything lol
For clarity, you are creating groups via the commands and then after shutdown the groups are not saved?
Correct. Is it possible to directly write to the groups.json?
well you could look at how the default group is created in the file and then write your own in there but I'm currently zooming through the code figuring out why it is not saving
No problem! I wrote the group system to be as independent from the "original" veinminer as possible (also toyed with the idea to completely rewrite it to be centered around groups) to not break compatibility and allow users to just ignore the feature if they are not interested
The groups.json is completely empty... that was my thought when trying set our own servers groups. Unless you're meaning in the .jar or somewhere other than the \config\Veinminer?
you can delete the file and restart the server to force veinminer to regenerate the file, then stop the server to make veinminer write it to disk
although im not sure if it works if youre telling me it doesnt save no matter what
I'll try it to see!
Do you happen to have the syntax for how the groups.json should be written so I could try that way as well?
yes sure!
name is the name of the group, and blocks is a list of all blocks in this group
I'll try that out and let you know what happens!
Thanks!
If I'm corrent we forgot to save the config at shutdown :KEKW:
That would cause it! lol
give me a second I'm waiting for intellij to complete the analysis and If thats it im gonna send you a build that fixes it
hmm actually save gets called everytime a command is issued
@Oatsilito could you maybe test adding a block to a group and check if it is written then
It is not, I'm finishing the direct write into the json now to see what that does
okay, I have to go for some time now but I'm gonna investigate it further and Miraculixx will surely help if any other issues arise
Sounds good. Thanks!
FYI: Direct writing did not work lol
have you restarted after writing?
veinminer only checks the files at startup
Yep! After restart, it is only recognizing the default list, which is not included on my custom groups.json
:Hmmm: very very weird
I'm gonna perform some tests and look what I can do
Sounds good š Thank you again!
completely forgot that trailing commas cause a problem... I'm just dumb
direct writing appears to have worked now. Thank you!
Oh yeah, maybe we could try to add the lenient parser flag to try fixing invalid json syntax. It can impact performance a little, but i guess its good to have here
@[object Object] when you test around for the saving, could you maybe try the flag?
Just got home from soccer :KEKW: Iām gonna work on it tomorrow
The perfomance impact should be negligable as the files are only read on startup and kotlinx.serialization is written with millions of lines of json in mind, not ~50
:2127jimstraightface: I found the error
The saving of the files was not the problem.
The problem was that I wrote the command code under the assumption that the config files are being saved automatically on shutdown, not via calling the save function manually
I'm gonna do some research on how add a shutdown hook on fabric to automate this
The reason for me to not save on shutdown is to easier modify the files directly. So it will not be overrided on shutdown
but veinminer doesnt read the files at runtime so the changes will be discarded when a command is issued so it doesnt really make a difference
From my experience people tend to edit the file and then hit restart
But i could add a reload command too
I'm gonna add that with the fix pull request give me a sec
@Oatsilito I just sent a PR to Miraculixx to fix the issues adressed, in the meantime you can use this version of Veinminer which is the mod with my changes applied