Update CraftBukkit to Minecraft 1.5
This commit is contained in:
@@ -16,14 +16,13 @@ import java.util.UUID;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
// CraftBukkit end
|
||||
|
||||
public class WorldNBTStorage implements IDataManager, PlayerFileData {
|
||||
public class WorldNBTStorage implements IDataManager, IPlayerFileData {
|
||||
|
||||
private static final Logger log = Logger.getLogger("Minecraft");
|
||||
private final File baseDir;
|
||||
private final File playerDir;
|
||||
private final File dataDir;
|
||||
private final long sessionId = System.currentTimeMillis();
|
||||
private final String f;
|
||||
private final String e;
|
||||
private UUID uuid = null; // CraftBukkit
|
||||
|
||||
public WorldNBTStorage(File file1, String s, boolean flag) {
|
||||
@@ -32,7 +31,7 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData {
|
||||
this.playerDir = new File(this.baseDir, "players");
|
||||
this.dataDir = new File(this.baseDir, "data");
|
||||
this.dataDir.mkdirs();
|
||||
this.f = s;
|
||||
this.e = s;
|
||||
if (flag) {
|
||||
this.playerDir.mkdirs();
|
||||
}
|
||||
@@ -174,7 +173,7 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData {
|
||||
try {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
|
||||
entityhuman.d(nbttagcompound);
|
||||
entityhuman.e(nbttagcompound);
|
||||
File file1 = new File(this.playerDir, entityhuman.name + ".dat.tmp");
|
||||
File file2 = new File(this.playerDir, entityhuman.name + ".dat");
|
||||
|
||||
@@ -185,11 +184,11 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData {
|
||||
|
||||
file1.renameTo(file2);
|
||||
} catch (Exception exception) {
|
||||
log.warning("Failed to save player data for " + entityhuman.name);
|
||||
MinecraftServer.getServer().getLogger().warning("Failed to save player data for " + entityhuman.name);
|
||||
}
|
||||
}
|
||||
|
||||
public void load(EntityHuman entityhuman) {
|
||||
public NBTTagCompound load(EntityHuman entityhuman) {
|
||||
NBTTagCompound nbttagcompound = this.getPlayerData(entityhuman.name);
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
@@ -199,8 +198,10 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData {
|
||||
player.setFirstPlayed(new File(playerDir, entityhuman.name + ".dat").lastModified());
|
||||
}
|
||||
// CraftBukkit end
|
||||
entityhuman.e(nbttagcompound);
|
||||
entityhuman.f(nbttagcompound);
|
||||
}
|
||||
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
public NBTTagCompound getPlayerData(String s) {
|
||||
@@ -211,13 +212,13 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData {
|
||||
return NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file1)));
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
log.warning("Failed to load player data for " + s);
|
||||
MinecraftServer.getServer().getLogger().warning("Failed to load player data for " + s);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public PlayerFileData getPlayerFileData() {
|
||||
public IPlayerFileData getPlayerFileData() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -240,7 +241,7 @@ public class WorldNBTStorage implements IDataManager, PlayerFileData {
|
||||
}
|
||||
|
||||
public String g() {
|
||||
return this.f;
|
||||
return this.e;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
|
||||
Reference in New Issue
Block a user