[SPIGOT-6814] (Chunk) PersistentData is lost after restart Created: 28/Nov/21  Updated: 28/Nov/21  Resolved: 28/Nov/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: byquanton Assignee: Marvin Rieple
Resolution: Fixed Votes: 1
Labels: API, PersistentDataContainer

Attachments: PNG File image-2021-11-28-19-51-52-500.png     PNG File image-2021-11-28-19-53-36-300.png     PNG File image-2021-11-28-20-07-16-800.png     Java Archive File testpersistentdata-1.0-SNAPSHOT.jar    
Version: CraftBukkit version 3323-Spigot-7514aa3-c86a3f7 (MC: 1.18 Release Candidate 3) (Implementing API version 1.18-rc3-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Reproduce Steps:
Start 1.18-rc3 Spigot Server with the Reproduction Plugin. Join the Server and enter `/testpersistent set test` and then to check if the Data is saved `/testpersistent get`. Restart the server and rejoin. `/testpersistent get` should output the same, but it doesn't. When using 1.17.1 it works.

Reproduction plugin source: https://github.com/byquanton/testpersistentdat



 Comments   
Comment by Marvin Rieple [ 28/Nov/21 ]

Made a PR for this: craftbukkit#965

Comment by md_5 [ 28/Nov/21 ]

Please do not link patches outside of the stash, we take the integrity of the CLA extremely seriously.

Comment by byquanton [ 28/Nov/21 ]

TL;RD  Loading the Data will delete it and the data is only saved when there are other changes in the chunk

I did some testing. It looks like the Server only saves the PersistentDataContainer in a chunk when there is a change (like @MrDoc94 mentioned). But if you start a 1.18 Server, the Data in the Chunks will be deleted (Upgrading the World also Deletes Data).

Comment by Doc [ 28/Nov/21 ]

Confirmed... this issue happen when change PersistentDataContainer in a chunk and this chunk not has another change...

 

For example if you run the command and put a random block in the chunk then the chunk is saved with the PersistentDataContainer correctly... if not then the chunk keep for not saving.

Comment by mfnalex [ 28/Nov/21 ]

Was going to report this too right now. 

Generated at Tue Apr 01 10:13:09 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.