Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
LemADEC opened this issue ยท 8 comments
Versions
- Minecraft: 1.12.2
- Forge: 1.12.2-14.23.4.2749
- Vampirism: 1.12.2-1.4.3
Issue Description
Console is periodically spammed with
[20:10:02] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:10:05] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:10:09] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:10:16] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:10:39] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:10:45] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:10:46] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:11:37] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:11:48] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:11:54] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:12:02] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:12:05] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:12:15] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:12:39] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
[20:12:55] [Server thread/WARN] [vampirism]: [VampirismVillage]Spawned to many hunters recently. Canceling. Pos BlockPos{x=0, y=0, z=0}
Reproduce Steps
Start server and generate the world?
Additional Information
The block position seems invalid too.
Issue should now be solved (by implementing a different village system)
Code improvement suggestions have been considered
Damn, forgot to include the invalid block position fix in the latest hotfix release.
There appears to be a rogue village somewhere (if it is a small server, you might be able to narrow it down, since it should only log this if the chunk is loaded). For some reasons it wants to spawn infinite hunters (maybe they instantly die or they somehow get moved outside of the village boundaries.
I will try to find a solution, but just removing the log would not fix the underlying problem. However, it would probably be better than nothing.
Our map is fairly large, so it would be helpful to get some coordinates.
What should we do when we find such a "buggy" village?
If you should be able to narrow it down and you do not need the village, you could just destroys all doors. That should make Minecraft eventually forget about it.
I made a custom patch to get block coordinates:
Pos BlockPos{x=-999, y=68, z=-866}
Pos BlockPos{x=-1001, y=67, z=-867}
Pos BlockPos{x=-1001, y=69, z=-863}
=> those 3 overlapping entries are from a small village inside spawn protected area
Pos BlockPos{x=-1416, y=106, z=688}
=> this was a villager in a blocked house on a cliff, the rest of the village had been raided already
Pos BlockPos{x=-2540, y=71, z=-817}
=> this was desert village with way too many hunters (32 hunters for 23 villagers)
Thank you very much for reporting this, it disproves my previous theory on how this might be able to happen.
It seems my approach on calculating the maximum hunter count is just not working. I still do not understand why, but several previous attempts of fixing this issue apparently did not work out.
So I think I will completely scrap the current system and try to perform the spawning in a different way. I am currently reworking villages anyways #241
I hope the console spam issue could be fixed by destroying the affected villages? Otherwise I might release another version, removing any village related logs, because the system is beyond remedy
Logs are already nerfed in our patched version, but others might want that fix.
From I've seen in the code, the villager center wasn't set properly so there was no way it would count the entities properly in the area.
Also, since you're reworking this class, it would be a good opportunity to improve memory management:
-
getBoundingBox() is creating the same AABB several times per tick.
=> Consider caching it and clearing every few seconds. -
the filterXXX() methods are creating a list with no defined size, this causes memory reallocation lag.
=> Consider pre-defining the size to the number of entities.