/// <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; } LateSpawn(); OwningRegion.AddCloudsToNewChunk(this); OwningRegion.NoticeChunkForUpperArea(WorldPosition); ChunkDetect(); if (IsNew) { OwningRegion.PushNewChunkDetailsToUpperArea(this); } IsNew = false; }
/// <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; }