    001    package net.minecraft.src;
    002
    003    import java.io.File;
    004
    005    public class AnvilSaveHandler extends SaveHandler
    006    {
    007        public AnvilSaveHandler(File par1File, String par2Str, boolean par3)
    008        {
    009            super(par1File, par2Str, par3);
    010        }
    011
    012        /**
    013         * Returns the chunk loader with the provided world provider
    014         */
    015        public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
    016        {
    017            File var2 = this.getSaveDirectory();
    018            File var3;
    019
    020            if (par1WorldProvider.getSaveFolder() != null)
    021            {
    022                var3 = new File(var2, par1WorldProvider.getSaveFolder());
    023                var3.mkdirs();
    024                return new AnvilChunkLoader(var3);
    025            }
    026            else
    027            {
    028                return new AnvilChunkLoader(var2);
    029            }
    030        }
    031
    032        /**
    033         * Saves the given World Info with the given NBTTagCompound as the Player.
    034         */
    035        public void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound)
    036        {
    037            par1WorldInfo.setSaveVersion(19133);
    038            super.saveWorldInfoWithPlayer(par1WorldInfo, par2NBTTagCompound);
    039        }
    040
    041        /**
    042         * Called to flush all changes to disk, waiting for them to complete.
    043         */
    044        public void flush()
    045        {
    046            try
    047            {
    048                ThreadedFileIOBase.threadedIOInstance.waitForFinish();
    049            }
    050            catch (InterruptedException var2)
    051            {
    052                var2.printStackTrace();
    053            }
    054
    055            RegionFileCache.clearRegionFileReferences();
    056        }
    057    }