Exemplo n.º 1
0
 /// <summary>
 /// Adds the chunk to the owning region.
 /// </summary>
 public void AddToWorld()
 {
     foreach (Entity e in entsToSpawn)
     {
         OwningRegion.SpawnEntity(e);
     }
     entsToSpawn.Clear();
     foreach (SyncScheduleItem s in fixesToRun)
     {
         s.MyAction.Invoke();
     }
     fixesToRun.Clear();
     if (Flags.HasFlag(ChunkFlags.ISCUSTOM))
     {
         return;
     }
     if (FCO != null)
     {
         return;
     }
     FCO = new FullChunkObject(WorldPosition.ToVector3() * CHUNK_SIZE, BlocksInternal);
     FCO.CollisionRules.Group = CollisionUtil.WorldSolid;
     OwningRegion.AddChunk(FCO);
     OwningRegion.AddCloudsToNewChunk(this);
     OwningRegion.NoticeChunkForUpperArea(WorldPosition);
     ChunkDetect();
     if (IsNew)
     {
         OwningRegion.PushNewChunkDetailsToUpperArea(this);
     }
     IsNew = false;
 }
Exemplo n.º 2
0
 public void LateSpawn()
 {
     if (FCO == null && BlocksInternal != null)
     {
         FCO = new FullChunkObject(WorldPosition.ToVector3() * CHUNK_SIZE, BlocksInternal);
         FCO.CollisionRules.Group = CollisionUtil.WorldSolid;
         OwningRegion.AddChunk(FCO);
     }
 }