    001package net.minecraft.world.storage;
    002
    003import java.io.File;
    004import net.minecraft.nbt.NBTTagCompound;
    005import net.minecraft.world.MinecraftException;
    006import net.minecraft.world.WorldProvider;
    007import net.minecraft.world.chunk.storage.IChunkLoader;
    008
    009public interface ISaveHandler
    010{
    011    /**
    012     * Loads and returns the world info
    013     */
    014    WorldInfo loadWorldInfo();
    015
    016    /**
    017     * Checks the session lock to prevent save collisions
    018     */
    019    void checkSessionLock() throws MinecraftException;
    020
    021    /**
    022     * Returns the chunk loader with the provided world provider
    023     */
    024    IChunkLoader getChunkLoader(WorldProvider worldprovider);
    025
    026    /**
    027     * Saves the given World Info with the given NBTTagCompound as the Player.
    028     */
    029    void saveWorldInfoWithPlayer(WorldInfo worldinfo, NBTTagCompound nbttagcompound);
    030
    031    /**
    032     * Saves the passed in world info.
    033     */
    034    void saveWorldInfo(WorldInfo worldinfo);
    035
    036    /**
    037     * returns null if no saveHandler is relevent (eg. SMP)
    038     */
    039    IPlayerFileData getSaveHandler();
    040
    041    /**
    042     * Called to flush all changes to disk, waiting for them to complete.
    043     */
    044    void flush();
    045
    046    /**
    047     * Gets the file location of the given map
    048     */
    049    File getMapFileFromName(String s);
    050
    051    /**
    052     * Returns the name of the directory where world information is saved.
    053     */
    054    String getWorldDirectoryName();
    055}