Package net.minecraft.src
Class SaveHandler
java.lang.Object
net.minecraft.src.SaveHandler
- All Implemented Interfaces:
IPlayerFileData,ISaveHandler
- Direct Known Subclasses:
AnvilSaveHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks the session lock to prevent save collisionsvoidflush()Called to flush all changes to disk, waiting for them to complete.String[]Returns an array of usernames for which player.dat exists for.getChunkLoader(WorldProvider par1WorldProvider) Returns the chunk loader with the provided world providerprotected FilegetDimensionDirectory(WorldServer world) getMapFileFromName(String par1Str) Gets the file location of the given mapgetPlayerData(String par1Str) Gets the player data for the given playername as a NBTTagCompound.returns null if no saveHandler is relevent (eg.protected FileGets the File object corresponding to the base directory of this world.Returns the name of the directory where world information is saved.voidloadModSpecificData(WorldServer world) Loads and returns the world inforeadPlayerData(EntityPlayer par1EntityPlayer) Reads the player data from disk into the specified PlayerEntityMP.voidsaveModSpecificData(WorldServer world) voidsaveWorldInfo(WorldInfo par1WorldInfo) Saves the passed in world info.voidsaveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound) Saves the given World Info with the given NBTTagCompound as the Player.protected voidCreates a session lock file for this processvoidwritePlayerData(EntityPlayer par1EntityPlayer) Writes the player data to disk from the specified PlayerEntityMP.
-
Field Details
-
worldDirectory
The directory in which to save world data. -
playersDirectory
The directory in which to save player data. -
saveDirectoryName
The directory name of the world
-
-
Constructor Details
-
SaveHandler
-
-
Method Details
-
setSessionLock
protected void setSessionLock()Creates a session lock file for this process -
getWorldDirectory
Gets the File object corresponding to the base directory of this world. -
checkSessionLock
Checks the session lock to prevent save collisions- Specified by:
checkSessionLockin interfaceISaveHandler- Throws:
MinecraftException
-
getChunkLoader
Returns the chunk loader with the provided world provider- Specified by:
getChunkLoaderin interfaceISaveHandler
-
loadWorldInfo
Loads and returns the world info- Specified by:
loadWorldInfoin interfaceISaveHandler
-
saveWorldInfoWithPlayer
Saves the given World Info with the given NBTTagCompound as the Player.- Specified by:
saveWorldInfoWithPlayerin interfaceISaveHandler
-
saveWorldInfo
Saves the passed in world info.- Specified by:
saveWorldInfoin interfaceISaveHandler
-
writePlayerData
Writes the player data to disk from the specified PlayerEntityMP.- Specified by:
writePlayerDatain interfaceIPlayerFileData
-
readPlayerData
Reads the player data from disk into the specified PlayerEntityMP.- Specified by:
readPlayerDatain interfaceIPlayerFileData
-
getPlayerData
Gets the player data for the given playername as a NBTTagCompound. -
getSaveHandler
returns null if no saveHandler is relevent (eg. SMP)- Specified by:
getSaveHandlerin interfaceISaveHandler
-
getAvailablePlayerDat
Returns an array of usernames for which player.dat exists for.- Specified by:
getAvailablePlayerDatin interfaceIPlayerFileData
-
flush
public void flush()Called to flush all changes to disk, waiting for them to complete.- Specified by:
flushin interfaceISaveHandler
-
getMapFileFromName
Gets the file location of the given map- Specified by:
getMapFileFromNamein interfaceISaveHandler
-
getWorldDirectoryName
Returns the name of the directory where world information is saved.- Specified by:
getWorldDirectoryNamein interfaceISaveHandler
-
loadModSpecificData
- Specified by:
loadModSpecificDatain interfaceISaveHandler
-
saveModSpecificData
- Specified by:
saveModSpecificDatain interfaceISaveHandler
-
getDimensionDirectory
-