public class SaveHandler extends Object implements ISaveHandler, IPlayerFileData
| Constructor and Description |
|---|
SaveHandler(File par1File,
String par2Str,
boolean par3) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkSessionLock()
Checks the session lock to prevent save collisions
|
void |
flush()
Called to flush all changes to disk, waiting for them to complete.
|
String[] |
getAvailablePlayerDat()
Returns an array of usernames for which player.dat exists for.
|
IChunkLoader |
getChunkLoader(WorldProvider par1WorldProvider)
Returns the chunk loader with the provided world provider
|
File |
getMapFileFromName(String par1Str)
Gets the file location of the given map
|
NBTTagCompound |
getPlayerData(String par1Str)
Gets the player data for the given playername as a NBTTagCompound.
|
IPlayerFileData |
getSaveHandler()
returns null if no saveHandler is relevent (eg.
|
File |
getWorldDirectory()
Gets the File object corresponding to the base directory of this world.
|
String |
getWorldDirectoryName()
Returns the name of the directory where world information is saved.
|
WorldInfo |
loadWorldInfo()
Loads and returns the world info
|
NBTTagCompound |
readPlayerData(EntityPlayer par1EntityPlayer)
Reads the player data from disk into the specified PlayerEntityMP.
|
void |
saveWorldInfo(WorldInfo par1WorldInfo)
Saves the passed in world info.
|
void |
saveWorldInfoWithPlayer(WorldInfo par1WorldInfo,
NBTTagCompound par2NBTTagCompound)
Saves the given World Info with the given NBTTagCompound as the Player.
|
void |
writePlayerData(EntityPlayer par1EntityPlayer)
Writes the player data to disk from the specified PlayerEntityMP.
|
public File getWorldDirectory()
public void checkSessionLock()
throws MinecraftException
checkSessionLock in interface ISaveHandlerMinecraftExceptionpublic IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
getChunkLoader in interface ISaveHandlerpublic WorldInfo loadWorldInfo()
loadWorldInfo in interface ISaveHandlerpublic void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound)
saveWorldInfoWithPlayer in interface ISaveHandlerpublic void saveWorldInfo(WorldInfo par1WorldInfo)
saveWorldInfo in interface ISaveHandlerpublic void writePlayerData(EntityPlayer par1EntityPlayer)
writePlayerData in interface IPlayerFileDatapublic NBTTagCompound readPlayerData(EntityPlayer par1EntityPlayer)
readPlayerData in interface IPlayerFileDatapublic NBTTagCompound getPlayerData(String par1Str)
public IPlayerFileData getSaveHandler()
getSaveHandler in interface ISaveHandlerpublic String[] getAvailablePlayerDat()
getAvailablePlayerDat in interface IPlayerFileDatapublic void flush()
flush in interface ISaveHandlerpublic File getMapFileFromName(String par1Str)
getMapFileFromName in interface ISaveHandlerpublic String getWorldDirectoryName()
getWorldDirectoryName in interface ISaveHandler