Better Animals Plus

Better Animals Plus

22M Downloads

Config File Not Working

InteJason opened this issue ยท 12 comments

commented

Describe the bug
The server still spawns animals despite them being disabled on the doSpawning line in the config

To Reproduce
Steps to reproduce the behavior:

  1. Start server and generate new world
  2. Stop the server, and edit the config file in the world config
  3. Disable animal spawning
  4. Join the server and see that the mobs disabled in config are still spawning

Expected behavior
Mobs disabled to stop spawning

Screenshots
If applicable, add screenshots to help explain your problem.

Versions:

  • Minecraft Version: 1.16.4
  • Forge Version: 35.1.13
  • Mod Version: Newest
commented

We tested this because we thought it was an issue. As far as I could tell, it was fine. Are you sure they are spawning and weren't pre-generated? Try teleporting a few thousand blocks away.

Is this only happening on the dedicated server? If you could, test this in singleplayer for me and report back (same thing, teleport far). We've been having spawning issues on the dedicated server, so it could be related to that.

commented

I'm pretty sure it's pre-generated. But is there a way to stop them from pre-generating all together?
I would also like to make a request to move the config file back from the world config directory to the normal config directory since it's easier for modpackers to manage spawning. It also removes the problem of pre-generated mobs.
Thanks for the response btw

commented

@InteJason The pregeneration occurs when the chunks are loaded and there's not a way to prevent it aside from the defaultconfig system. The config won't be moving back, but pack-makers should know about the defaultconfigs folder (a Forge feature, it applies for any server config). Just place the server config in .minecraft/defaultconfigs, and it will copy the server config to new worlds.

commented

i've also noticed issues with changes made to config not working
here is my current config in my defaultconfigs folder: https://pastebin.com/ep1aR2uy
copy pasted from a world saves server config and adjusted then loaded a new world
bears spawning even when dospawning = false
horseshoe crabs spawning in biomes not listed in its list (spawnBiomes = [])

betteranimalsplus-1.16.4-10.1.0
minecraft 1.16.4
forge-35.1.37

commented

Would you guys say you have large to moderate-sized modpacks? I have a suspicion this issue is caused by race conditions in asynchronous mod loading relating to the time at which configuration loads, which would be exacerbated by larger amounts of mods loading. Do you notice this issue using only a few mods; or even only BAP? I've personally tested it in and outside the dev environment with low mod counts and I was unable to reproduce it sustainably outside some weird behavior occasionally that was fixed after restarting the game.

commented

Yeah for sure. 124 mods.

commented

So I've done some investigation.

On the dedicated server, the biomes and spawns are just loaded before the server configuration is, causing this issue for the dedicated server.

I've also noticed similar issues in singleplayer, however singleplayer is a bit more complicated.
It first loads the biomes on the Render/client thread, and then loads the server configuration on the server thread, and then loads biomes again on the Netty Local Client IO thread. What's weird about this it seems to work, but ONLY after you restart your game, and things will still spawn the first load.

So... this leads to an issue.
The configuration needs to load before biomes on the server OR spawns need to be dynamically changed during runtime.
Both of which sound equally unplausible.

Man, I hate 1.16.2+ biomes.

commented

Okay. So I'm not completely sure if I managed to fix this. In my testing, I was able to reproduce the issue you talked about in the dedicated server easily. The changes I made appear to have fixed it. Let me know how it goes using this alpha build, please!
https://github.com/itsmeow/betteranimalsplus/releases/tag/alpha-1.16.4-10.1.0.12

commented

Hate to necro this issue, but I'm having this exact issue, and this probably makes more sense than making a new issue.

Version: 1.16.4-10.1.0
Forge: 36.1.0

I had first reduced the spawn weight to 1 for both boars and lampreys. This did not seem to have any affect. I then changed doSpawning to false for both. Lampreys are still dominating lakes and rivers, but I think that it did work for boars, as I haven't seen any yet.

This is happening in a brand new world created after the config was changed and copied to defaultConfigs. It is also in a large-ish pack with Biomes O' Plenty. I plan to do more testing with vanilla worldgen and fly around in creative looking for boars, but I don't have any more time tonight and wanted to alert you to this issue.

commented

Oh, sorry. Immediately after submitting that, I noticed that the alpha you referenced above is newer than the release I'm using. I will test with that tomorrow and let you know if it fixes the issue for me.

commented

I can confirm that this bug is reproducible in single player without BOP with the current release (10.1.0), but only for lampreys, not boars. I can also confirm that it is definitely working correctly in the latest alpha.

commented

Good to know. The release will be out sometime this month ?? as far as I know