MCA Reborn [Fabric/Forge]

MCA Reborn [Fabric/Forge]

7M Downloads

Villagers not spawning on pre-generated Worlds

ElYidra opened this issue · 3 comments

commented

Describe the bug
When I create a world and pre-generate the world with Chunky (for server performance matters), only all villages within the range that was pre-generated are empty. The villages are recognized by Minecraft and there's no problem with that.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new World
  2. Enter the world and spawn in somewhere (Haven't tested with spawning on a default village, and also all players are with vanilla since I've been running this on a server)
  3. Pregenerate an area that contains a village using Chunky

Version
Minecraft 1.20.1 Forge 47.3.22 (I've also have the same problem with fabric, but I don't remember the details)

Additional Mods I believe could be related to
Chunky 1.3.146
Towns and Towers 1.12
Terralith 2.5.4
Alex Mobs 1.22.9
Let me despawn 1.4.4

Logs
Sometimes it spams this messages randomly while server running

[26Dec2024 20:45:46.846] [Server thread/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.ZombieVillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 20:45:46.851] [Server thread/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.ZombieVillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 20:45:46.854] [Server thread/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.ZombieVillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 20:45:46.855] [Server thread/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.ZombieVillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 20:45:46.856] [Server thread/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.ZombieVillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 20:45:46.857] [Server thread/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.ZombieVillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 20:45:46.858] [Server thread/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.ZombieVillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter

Or this other ones (at server startup)

[26Dec2024 16:38:32.968] [main/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.VillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 16:38:32.969] [main/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.VillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 16:38:32.970] [main/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.VillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 16:38:32.971] [main/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.VillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 16:38:32.972] [main/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.VillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter
[26Dec2024 16:38:32.972] [main/WARN] [net.minecraft.network.syncher.SynchedEntityData/]: defineId called for: class forge.net.mca.entity.VillagerEntityMCA from class forge.net.mca.util.network.datasync.CDataParameter

Also I did not found any console messages while world generation

commented

I'd also like more information on this as my server requires pre-gen to run well with the amount of mods I use. It seems this is a long standing and well known issue that, according to the MCA discord, has yet to be resolved. According the the Chunky discord, however, they think it has been resolved but it seems to obviously not be. The issue seems to stem from the fact that chunky does not tick (pass any time) the chunks that are generated, yet the way MCA spawns villagers requires Minecraft to tick during the villager spawns. The fix would seem be to change the way villagers spawn so that they all generate during the world gen portion not after during the first ticks. Im not sure why this wasn't the way it was done, maybe to stop stuttering when discovering a village without pre-gen.

For the time being, I wonder if you might try using these arguments when starting Minecraft in your Java argument. These cause chunky to tick each chunk for a short period when generating each one. This could tell us if ticking is indeed the issue.

As an example, add these to your java startup:

-Dchunky.maxWorkingCount=10000
-Dchunky.tickingLoadDuration=30
-Dchunky.awaitTicketRemoval=true
-Dchunky.sampleInterval=300

commented

Apparently that's the issue, although for what I've been testing around it only works on new worlds trying to re-generate chunks doesn't solve the issue and the villagers on those villages are gone. I will be testing a little bit more, this was a really quick testing so there could be other things too

commented

Yeah I took a look at the code a little closer. Definitely once a village is generated the original villagers are deleted. Possibly using the "trim" command to delete the chunks before regeneration might work. Still using the arguments is only a patchwork over the issue as it would cause gen to take way longer I think. The code section responsible for converting villagers to MCA is spawnQueue.java class and there's a note that implies generating MCA villagers during world gen is "impossible" so maybe we're SOL for that approach. I'm hopeful it could be fixed still. Otherwise, pre-generating with the option to have 100% of villagers stay vanilla could get all the villages to have villagers that arn't converted. Then having an option to convert all villagers to MCA as soon as a player loads them into a chunk while playing maybe.