/// <summary>
 /// Called when the data in this object is now (but not previously)
 /// what we want it to be.
 /// </summary>
 public void CleanAndValidate()
 {
     lock (this)
     {
         TouchingEntities.Clear();
         NeedsToBeLoaded = false;
         EntitiesSpawned = false;
     }
 }
            /// <summary>
            /// Called when the data in this object is no longer what we
            /// want it to be.  The arguments are used to determine if we
            /// really need to mark this as a new task (if it's already
            /// saved, don't bother, it's just extra work).
            /// </summary>
            /// <param name="newChunkX"></param>
            /// <param name="newChunkZ"></param>
            /// <param name="cache"></param>
            public void Invalidate(int newChunkX, int newChunkZ, ChunkCache cache)
            {
                lock (this)
                {
                    if (cache.HasSavedChunk(newChunkX, newChunkZ))
                    {
                        NeedsToBeLoaded = false;
                    }
                    else
                    {
                        NeedsToBeLoaded = true;
                    }

                    EntitiesSpawned = false;
                    TouchingEntities.Clear();
                }
            }