From cbd20ec9eae853ccd51d5395b5c0a180fa8c9499 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Tue, 1 May 2012 22:34:23 -0500 Subject: [PATCH] Use a different temp file for each player to avoid corruption. Fixes BUKKIT-1607 --- src/main/java/net/minecraft/server/WorldNBTStorage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java index 517e2f8ad1..bf2a1ced99 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -173,7 +173,7 @@ public class WorldNBTStorage implements PlayerFileData, IDataManager { NBTTagCompound nbttagcompound = new NBTTagCompound(); entityhuman.d(nbttagcompound); - File file1 = new File(this.playerDir, "_tmp_.dat"); + File file1 = new File(this.playerDir, entityhuman.name + ".dat~"); // CraftBukkit - don't save every player to the same file File file2 = new File(this.playerDir, entityhuman.name + ".dat"); NBTCompressedStreamTools.a(nbttagcompound, (OutputStream) (new FileOutputStream(file1)));