Ensure player data is completely saved on shutdown.
Changed shutdown data save to synchronous (from multithreaded). Takes longer but guarantees all data gets saved.
This commit is contained in:
parent
370f94a531
commit
a3d4a39e86
|
|
@ -564,6 +564,12 @@ public abstract class DataStore
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//saves changes to player data to secondary storage. MUST be called after you're done making changes, otherwise a reload will lose them
|
||||||
|
public void savePlayerDataSync(UUID playerID, PlayerData playerData)
|
||||||
|
{
|
||||||
|
this.asyncSavePlayerData(playerID, playerData);
|
||||||
|
}
|
||||||
|
|
||||||
//saves changes to player data to secondary storage. MUST be called after you're done making changes, otherwise a reload will lose them
|
//saves changes to player data to secondary storage. MUST be called after you're done making changes, otherwise a reload will lose them
|
||||||
public void savePlayerData(UUID playerID, PlayerData playerData)
|
public void savePlayerData(UUID playerID, PlayerData playerData)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2226,7 +2226,7 @@ public class GriefPrevention extends JavaPlugin
|
||||||
Player player = players[i];
|
Player player = players[i];
|
||||||
UUID playerID = player.getUniqueId();
|
UUID playerID = player.getUniqueId();
|
||||||
PlayerData playerData = this.dataStore.getPlayerData(playerID);
|
PlayerData playerData = this.dataStore.getPlayerData(playerID);
|
||||||
this.dataStore.savePlayerData(playerID, playerData);
|
this.dataStore.savePlayerDataSync(playerID, playerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dataStore.close();
|
this.dataStore.close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user