public Chunk loadChunk(int par1, int par2)
    {
        long var3 = ChunkCoordIntPair.chunkXZ2Int(par1, par2);
        this.droppedChunksSet.remove(Long.valueOf(var3));
        Chunk var5 = (Chunk)this.chunkMap.getValueByKey(var3);

        if (var5 == null)
        {
            int var6 = 1875004;

            if (par1 < -var6 || par2 < -var6 || par1 >= var6 || par2 >= var6)
            {
                return this.emptyChunk;
            }

            var5 = this.loadChunkFromFile(par1, par2);

            if (var5 == null)
            {
                if (this.chunkProvider == null)
                {
                    var5 = this.emptyChunk;
                }
                else
                {
                    var5 = this.chunkProvider.provideChunk(par1, par2);
                }
            }

            this.chunkMap.add(var3, var5);
            this.chunkList.add(var5);

            if (var5 != null)
            {
                var5.func_4143_d();
                var5.onChunkLoad();
            }

            var5.populateChunk(this, this, par1, par2);
        }

        return var5;
    }