InfernalSuite / AdvancedSlimePaper

Advanced Slime World Manager as a Paper Fork
GNU General Public License v3.0
248 stars 85 forks source link

Sometimes chunks are not saved #84

Closed artur9010 closed 5 months ago

artur9010 commented 1 year ago

Describe the issue

After gracefully stopping server (/stop) and starting it again some chunks was not saved. I didn't seen any errors in logs.

image

Spigot version Build 1436 from Discord. I also tried to edit map on purpur fork - same issue.

Plugin version as above

emmanuelvlad commented 11 months ago

iirc, I had this issue when stopping the server the map would not save because the lock was released before saving it, my PR https://github.com/InfernalSuite/AdvancedSlimePaper/pull/56 should fix this issue

emmanuelvlad commented 9 months ago

When chunk gets unloaded it will replace the in memory chunk with a SlimeChunkSkeleton Mutating a loaded (but previously unloaded) chunk will have no effect when saving the world because the chunk is referencing the SlimeChunkSkeleton Getting further from the loaded chunk will call the unload method which will replace the in memory chunk, thus saving the chunk state properly.

To sum up, unloaded chunks that gets loaded back will not reflect the chunk in the save until it gets unloaded again. Commenting SlimeInMemoryWorld.java:115 solves this issue, but could it have any side effects?

Semi related issue: Spawning on a world (PlayerSpawnLocationEvent) makes the chunk (on which the player spawned) unload

kyngs commented 5 months ago

Fixed in https://github.com/InfernalSuite/AdvancedSlimePaper/commit/cb50193868308739db2b21776c119d3f490e234e