    001    package net.minecraft.world;
    002
    003    import net.minecraft.nbt.NBTTagCompound;
    004
    005    public abstract class WorldSavedData
    006    {
    007        /** The name of the map data nbt */
    008        public final String mapName;
    009
    010        /** Whether this MapDataBase needs saving to disk. */
    011        private boolean dirty;
    012
    013        public WorldSavedData(String par1Str)
    014        {
    015            this.mapName = par1Str;
    016        }
    017
    018        /**
    019         * reads in data from the NBTTagCompound into this MapDataBase
    020         */
    021        public abstract void readFromNBT(NBTTagCompound var1);
    022
    023        /**
    024         * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities
    025         */
    026        public abstract void writeToNBT(NBTTagCompound var1);
    027
    028        /**
    029         * Marks this MapDataBase dirty, to be saved to disk when the level next saves.
    030         */
    031        public void markDirty()
    032        {
    033            this.setDirty(true);
    034        }
    035
    036        /**
    037         * Sets the dirty state of this MapDataBase, whether it needs saving to disk.
    038         */
    039        public void setDirty(boolean par1)
    040        {
    041            this.dirty = par1;
    042        }
    043
    044        /**
    045         * Whether this MapDataBase needs saving to disk.
    046         */
    047        public boolean isDirty()
    048        {
    049            return this.dirty;
    050        }
    051    }