public void spawnPlayerWithLoadedChunks(EntityPlayer par1EntityPlayer)
    {
        try
        {
            NBTTagCompound var2 = this.worldInfo.getPlayerNBTTagCompound();

            if (var2 != null)
            {
                par1EntityPlayer.readFromNBT(var2);
                this.worldInfo.setPlayerNBTTagCompound((NBTTagCompound)null);
            }

            if (this.chunkProvider instanceof ChunkProviderLoadOrGenerate)
            {
                ChunkProviderLoadOrGenerate var3 = (ChunkProviderLoadOrGenerate)this.chunkProvider;
                int var4 = MathHelper.floor_float((float)((int)par1EntityPlayer.posX)) >> 4;
                int var5 = MathHelper.floor_float((float)((int)par1EntityPlayer.posZ)) >> 4;
                var3.setCurrentChunkOver(var4, var5);
            }

            this.spawnEntityInWorld(par1EntityPlayer);
        }
        catch (Exception var6)
        {
            var6.printStackTrace();
        }
    }