ServerCore

ServerCore

384k Downloads

Feature suggestion

redstonerti opened this issue ยท 2 comments

commented

I had my server crash multiple times due to a watchdog (a single server tick took > 60 seconds) because a player opened a chest that didn't have loot generated in it that also contained an exploration map. This map caused the server to crash because it had to locate a structure, and that has become very slow in 1.19. Could you please make a config option / way to pregenerate loot in chests, minecarts, whatever? Ideally I could do this after all my chunks are generated, maybe with a command so that this can apply to worlds that have already been pregenerate (like mine). That would be greatly appreciated.

Thanks.

commented

This is related to MC-249136. Ever since 1.19 snapshots locating buried treasure takes extremely long (they also had the same issue throughout 1.18 snapshots but that never made it into the release).

Other structures should be mostly fine, at least as far as I can tell none of them get anywhere near crashing the server to locate, unlike buried treasure.

The temporary solution I'm running myself at the moment is to just cancel any attempts to locate buried treasure, which results in blank maps (but regardless, that would probably happen without it aswell - see MC-218156).

Another option could be to use (or find another) datapack, that replaces the buried treasure map in the loot table with something else.

Back to the feature suggestion though, its fairly out of scope for this project. Loot generation - as far as I can tell - often uses a player, and faking that would mean you might end up with non-vanilla behavior (although I don't really know loot generation too well, but if I were to make this it would most likely go wrong).

This would undoubtedly also cause the same issues - if not worse - whilst generating chunks at all because its trying to locate structures everywhere. Pregenning would be somewhat of a solution but it would take forever to do, if it doesn't crash 5 minutes in because it ran across a buried treasure map.

And if you want to "fix" existing terrain, you would need said command that would have to go through all the region files to 'fix' already existing chunks, which isn't really something I want to deal with.

In other words, I don't think this is worth making. I would recommend using one of the alternatives listed above (or in case there already is a mod that fixes this specific lagspike, that would be a good solution aswell).

commented

Fair enough. Thanks for the explanation ๐Ÿ‘Œ