Esempio n. 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void Func_48447_a(AnvilChunkLoaderPending par1AnvilChunkLoaderPending) throws IOException
        private void Func_48447_a(AnvilChunkLoaderPending par1AnvilChunkLoaderPending)
        {
            Stream dataoutputstream = RegionFileCache.GetChunkOutputStream(ChunkSaveLocation, par1AnvilChunkLoaderPending.Field_48427_a.ChunkXPos, par1AnvilChunkLoaderPending.Field_48427_a.ChunkZPos);

            CompressedStreamTools.Write(par1AnvilChunkLoaderPending.Field_48426_b, new BinaryWriter(dataoutputstream));
            dataoutputstream.Close();
        }
Esempio n. 2
0
        /// <summary>
        /// Loads the specified(XZ) chunk into the specified world.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public Chunk loadChunk(World par1World, int par2, int par3) throws IOException
        public virtual Chunk LoadChunk(World par1World, int par2, int par3)
        {
            NBTTagCompound    nbttagcompound    = null;
            ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(par2, par3);

            lock (Field_48450_c)
            {
                if (Field_48449_b.Contains(chunkcoordintpair))
                {
                    int i = 0;

                    do
                    {
                        if (i >= Field_48451_a.Count)
                        {
                            break;
                        }

                        if (Field_48451_a[i].Field_48427_a.Equals(chunkcoordintpair))
                        {
                            nbttagcompound = Field_48451_a[i].Field_48426_b;
                            break;
                        }

                        i++;
                    }while (true);
                }
            }

            if (nbttagcompound == null)
            {
                Stream datainputstream = RegionFileCache.GetChunkFileStream(ChunkSaveLocation, par2, par3);

                if (datainputstream != null)
                {
                    nbttagcompound = CompressedStreamTools.Read(new BinaryReader(datainputstream));
                }
                else
                {
                    return(null);
                }
            }

            return(Func_48443_a(par1World, par2, par3, nbttagcompound));
        }
Esempio n. 3
0
 public override void FlushCache()
 {
     RegionFileCache.ClearRegionFileReferences();
 }