iChun / Hats

My contributions to ModJam, a hats mod!
GNU Lesser General Public License v3.0
34 stars 58 forks source link

[Request] Better documentation for server configuration #228

Open spiritedsnowcat opened 3 years ago

spiritedsnowcat commented 3 years ago

Hi there,

I was running a server with the hats mod enabled, and things got really out of hand with every mob having a hat after a few hours of people logging in and logging out. Maybe that's a bug on its own, but 10% was too high of a spawn chance for our server. I wanted a simple way to reduce it to 0.5% chance, but couldn't find an options file for the mod in the forge config or mod folders. I read through the source code trying to figure out where the default file is before just uninstalling the mod. Some better documentation around that would be really helpful (I'd like to reintroduce the mod).

Thanks so much, Spirited

iChun commented 3 years ago

Hiya,

Every mob having a hat after a few hours seems like a bug indeed, mobs which have already spawned without a hat should not be re-allocated hats later on when they re-spawn, so I might have to look into this.

The problem with this issue is that configs existing in the server/world folder is a Forge feature, and although I've had my bad experiences with configs in the world folder in the past (way way long ago), it was the only Forge config type that would sync between servers and clients. Using the in-game config editor would have at least shown that there exists a server config, but unfortunately server-side there is no editor.

I could make a comment in the other configs informing users of the existence of the server config but at the same time I feel it's somewhat redundant to have to do so since this is a forge feature and many other mods also have configs stored on the server, if you know what I mean?

spiritedsnowcat commented 3 years ago

Ahh, I see. That would explain why hats got so out of control. And thanks for the info about config files, I didn't know this mod was so separate from Forge's APIs in general. It makes sense now if there's no general approach that covers all server cases. Would it be possible to expose it as a game rule command or something similar? (Sorry if I'm just spitballing ideas).

iChun commented 3 years ago

No, no, you misunderstand. Server side configs (the configs that are saved in the world folder), is part of the Forge feature set. I've just personally had bad experience with this in the past because everyone expects the config files to be in the config folder. This was years before Forge added server configs, and since forge supports it now, it's less of an issue as more people are aware of it.

I've not looked into adding game rules, so I'm unfortunately unfamiliar with them, but my configs use formats that are not supported by game rules (eg lists) so it's unlikely I'd switch to that.