How-Bout-No / Outvoted

Outvoted is a Minecraft mod that adds in mobs from previous mob votes that weren't able to make it into the game, trying to stay true to the original concepts.
GNU General Public License v3.0
22 stars 10 forks source link

[BUG][Fabric/1.17.1][Server] Configs of unrelated mods in Outvoted folder #61

Closed llndqvst closed 3 years ago

llndqvst commented 3 years ago

Describe the bug Running outvoted on a server causes some configs for other mods to be duplicated inside config/outvoted/.

To Reproduce Steps to reproduce the behavior:

  1. Run fabric-server with outvoted installed.

Expected behavior Outvoted should only create its own configs inside config/outvoted.

Screenshots/Logs

[fedora@cdc smp-fabric-modded]$ ls -l config/outvoted/
total 64
drwxr-xr-x. 2 fedora fedora 4096 Aug  2 21:30 VillagerNames
-rw-r--r--. 1 fedora fedora  814 Aug  2 21:30 adventurez.json5
-rw-r--r--. 1 fedora fedora  589 Aug  2 21:30 bettermineshafts-fabric-1_17.toml
-rw-r--r--. 1 fedora fedora  880 Aug  2 21:30 betterstrongholds-fabric-1_17.toml
-rw-r--r--. 1 fedora fedora 1608 Aug  2 21:30 bosses_of_mass_destruction.json5
-rw-r--r--. 1 fedora fedora 1436 Aug  2 21:30 common.json
-rw-r--r--. 1 fedora fedora 2330 Aug  2 21:30 conjuring.json5
-rw-r--r--. 1 fedora fedora  409 Aug  2 21:30 dragonloot.json5
-rw-r--r--. 1 fedora fedora 2192 Aug  2 21:30 eldritch_mobs.json5
-rw-r--r--. 1 fedora fedora 1600 Aug  2 21:30 hookshot.json5
-rw-r--r--. 1 fedora fedora 1825 Aug  2 21:30 npcvariety.json5
-rw-r--r--. 1 fedora fedora   81 Aug  2 21:30 redbits.json
drwxr-xr-x. 2 fedora fedora 4096 Aug  2 21:30 sihywtcamc
drwxr-xr-x. 2 fedora fedora 4096 Aug  2 21:29 sihywtcamd
-rw-r--r--. 1 fedora fedora   85 Aug  2 21:30 voidz.json5
-rw-r--r--. 1 fedora fedora  172 Aug  2 21:30 xp_storage.json5

Version (please complete the following information):

How-Bout-No commented 3 years ago

Oh that's weird. Does it break any of the other configs or is it just a duplicate?

llndqvst commented 3 years ago

From what I can see all the configs are created correctly, just in the wrong directory.

The main problem it's causing for me is the need to find what mods configs end up in outvoted, and edit the file there instead of in the config/ dir. In the context of creating a modpack or maintaining a server this is quite annoying.

I think I have found what causes the issue: https://github.com/How-Bout-No/Outvoted/blob/a2cb9307cae08439ae69395071ca8eae80cedab5/common/src/main/java/io/github/how_bout_no/outvoted/mixin/MixinUtils.java#L16

That mixin seems to stick and the new folder gets applied to any mods loaded after it.

One simple fix I've found is to simply remove MixinUtils.java from loading, and use the same code as the client to generate the config. This will however create a client config on the server as well, but it does not seem to cause any other issues. I'm unsure which git-branch you're tracking for new changes, so if you tell me which you prefer between architectury-dev and arch-1.17 I can submit a pull request.

How-Bout-No commented 3 years ago

I certainly overlooked my mixin implementation, since in dev of course I don't have other mods loaded. The original point was to achieve a similar folder structure on the server as the client without the client config present as cloth config didn't allow me to do that. I was considering just removing MixinUtils and rename the config files but that would require each user to do extra steps. So I guess just using the client config code would work, although it won't be as pretty 😄

You can pr to either branch. arch-1.17 is currently just for the Fabric 1.17 version, while architectury-dev is for both the 1.16.5 versions.

llndqvst commented 3 years ago

Submitted for arch-1.17 since that's the one I've actually tested :sweat_smile:

How-Bout-No commented 3 years ago

No problem, I'll mirror the fix to the lower versions. Fix will be included in alpha 11 for 1.17.

llndqvst commented 3 years ago

Great! Also I have to say that I agree with you that this fix isn’t the prettiest and that the intended old behavior probably should be targeted.

How-Bout-No commented 3 years ago

Implemented in Forge alpha 10 and Fabric alpha 11