FIX: Chests stop being converted (maximum_age)
noobanidus opened this issue ยท 0 comments
This is an issue that can occur on servers with low TPS.
Lootr works by detecting the create of compatible block entities during world generation, then placing their location (dimension and position) into a queue, delaying replacement until it can take place on the main thread.
This is for two reasons:
- The level being generated is usually not accessible from this context and using the "real" level will result in a deadlock, as it is still generating.
- In versions after 1.17, changing a block causes an area of 25 chunks (5x5 centered on the chunk the block entity is) to be loaded. If these chunks are not yet generated, this will cause world generation to take place on the main thread, generally resulting in severe lag or a deadlock.
In order to keep the queue fresh, entries are discarded after the configuration maximum_age
ticks have occurred. By default, this is 3 minutes (20 * 60 * 3
).
On servers where world generation is slow, or ticks are skipped due to low TPS, especially servers which have been running for a long period of time or have a large number of players, this sometimes results in entries being discarded before generation is complete. This may be intermittent or inconsistent, resulting in only some chests being converted.
The fix for this is to increase the value of maximum_age
(something like ten minutes, or 20 * 60 * 10
, should suffice).
Alternately, leaving the area or otherwise causing those chunks to unload (such as by restarting the server) and then returning to the location should successfully convert containers.
Note: If you open a Vanilla loot container, its loot table will be wiped, preventing it from being converted if it is reloaded.