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
[object Object]
[object Object]•11mo ago
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?
Oatsilito
OatsilitoOP•11mo ago
Our server is on Fabric. Is there a way to disable the default group and override it with the custom groups?
[object Object]
[object Object]•11mo ago
you can /veinminer groups remove Ores to remove the default ore group
Oatsilito
OatsilitoOP•11mo ago
Gotcha! I wasn't sure if that would break anything lol
[object Object]
[object Object]•11mo ago
For clarity, you are creating groups via the commands and then after shutdown the groups are not saved?
Oatsilito
OatsilitoOP•11mo ago
Correct. Is it possible to directly write to the groups.json?
[object Object]
[object Object]•11mo ago
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
Oatsilito
OatsilitoOP•11mo ago
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?
[object Object]
[object Object]•11mo ago
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
Oatsilito
OatsilitoOP•11mo ago
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?
[object Object]
[object Object]•11mo ago
yes sure!
[
{
"name": "NAME",
"blocks": [
"block.minecraft.iron_ore",
"block.minecraft.coal_ore",
]
},
{
"name": "ETC",
"blocks": [
],
},
]
[
{
"name": "NAME",
"blocks": [
"block.minecraft.iron_ore",
"block.minecraft.coal_ore",
]
},
{
"name": "ETC",
"blocks": [
],
},
]
name is the name of the group, and blocks is a list of all blocks in this group
Oatsilito
OatsilitoOP•11mo ago
I'll try that out and let you know what happens! Thanks!
[object Object]
[object Object]•11mo ago
If I'm corrent we forgot to save the config at shutdown :KEKW:
Oatsilito
OatsilitoOP•11mo ago
That would cause it! lol
[object Object]
[object Object]•11mo ago
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
Oatsilito
OatsilitoOP•11mo ago
It is not, I'm finishing the direct write into the json now to see what that does
[object Object]
[object Object]•11mo ago
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
Oatsilito
OatsilitoOP•11mo ago
Sounds good. Thanks! FYI: Direct writing did not work lol
[object Object]
[object Object]•11mo ago
have you restarted after writing? veinminer only checks the files at startup
Oatsilito
OatsilitoOP•11mo ago
Yep! After restart, it is only recognizing the default list, which is not included on my custom groups.json
[object Object]
[object Object]•11mo ago
:Hmmm: very very weird I'm gonna perform some tests and look what I can do
Oatsilito
OatsilitoOP•11mo ago
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!
Miraculixx
Miraculixx•11mo ago
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?
[object Object]
[object Object]•11mo ago
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
Miraculixx
Miraculixx•11mo ago
The reason for me to not save on shutdown is to easier modify the files directly. So it will not be overrided on shutdown
[object Object]
[object Object]•11mo ago
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
Miraculixx
Miraculixx•11mo ago
From my experience people tend to edit the file and then hit restart But i could add a reload command too
[object Object]
[object Object]•11mo ago
I'm gonna add that with the fix pull request give me a sec
[object Object]
[object Object]•11mo ago
@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

Did you find this page helpful?