CivClassic / CivModCore

Plugin Core and general purpose API for Civ Plugins - Updated for Paper 1.16.5
BSD 3-Clause "New" or "Revised" License
2 stars 20 forks source link

Improve ChunkMetaListener synchronisation #103

Closed okx-code closed 2 years ago

okx-code commented 3 years ago

The current synchronisation is completely unnecessary, and doesn't even work properly causing huge lag spikes.

Adding something to a list should not take 10 seconds https://spark.lucko.me/zRrVMye37N

Maxopoly commented 3 years ago

This will introduce a dangerous dupey race condition between the chunk meta loading and unloading. You need to prevent loading the chunk meta while its still being saved out. I did this by blocking the entire unloading queue, you could likely do it in a more sensible way with a key value store.

Diet-Cola commented 2 years ago

Superceded by https://github.com/CivMC/CivModCore/pull/17