DynamicTreesTeam / DynamicTrees

Minecraft Forge mod providing dynamic trees that progressively grow from seed to maturity.
MIT License
248 stars 98 forks source link

generateDirtBucketRecipes config setting not respected at first #630

Closed copygirl closed 2 years ago

copygirl commented 3 years ago

Description

When setting generateDirtBucketRecipes to false, the setting is ignored until /reload is run once. I have a hunch that the world config is loaded only after the recipes are already registered.

To Reproduce

Screenshots

image

Mods List

25 mods The modpack is also on GitHub. (Also reproducible with just DT.)

Versions

Harleyoc1 commented 3 years ago

When setting generateDirtBucketRecipes to false, the setting is ignored until /reload is run once. I have a hunch that the world config is loaded only after the recipes are already registered.

Yeah. The world config is probably not loaded until after datapack loading. I've come up with two potential solutions:

  1. Put the option in the common config. Downside is that you can no longer enable/disable them per world.
  2. Put the option in both the common and server config. Use the common config when server config has not loaded yet (assuming that is possible with config interfaces provided by Forge).

Which do you think is the best solution for your use-case? I can't see a real use for this option outside of changing recipes in bulk for a modpack, so perhaps the former is sufficient.

copygirl commented 3 years ago

I find the per-world config more annoying than useful.

As a modpack creator, it creates more headache than necessary. First of all the settings are in an odd place, only generated when you create a world. Then, say you find an issue with a config setting that can cause the game to crash. When you fix it, you have no way of updating the already-created per-world server config - at least not without the use of a mod.

Per-world config could perhaps be done with gamerules? That would at least work for simple options. Not sure if gamerules are available before the recipes are loaded either, though. I would definitely not put the setting in two places, with one only loaded in specific circumstances.

Harleyoc1 commented 3 years ago

Yeah. That was meant as more of a workaround solution in case anyone was adamant about having per-world configs, but I guess it doesn’t really solve that problem for per-world configs anyway thinking on it again. I’ll go ahead with the first solution.

copygirl commented 2 years ago

Interestingly enough, the inability to change this setting basically causes my modpack to crash when I removed all the recipes from the game using KubeJS. I had to build a custom version of Dynamic Trees which moved it over to common config.

Harleyoc1 commented 2 years ago

OK. Apologies for my lack of promptness on such a simple change, I've just been busy recently. Feel free to submit a PR for it if you'd like.