예제 #1
0
 private void SpawnForcedEntities()
 {
     if (this._forcedSpawns.Count == 0)
     {
         return;
     }
     for (int index = this._forcedSpawns.Count - 1; index >= 0; --index)
     {
         AmbienceServer.AmbienceSpawnInfo forcedSpawn = this._forcedSpawns[index];
         Player player;
         if (forcedSpawn.targetPlayer == -1)
         {
             AmbienceServer.FindPlayerThatCanSeeBackgroundAmbience(out player);
         }
         else
         {
             player = Main.player[forcedSpawn.targetPlayer];
         }
         if (player != null && this.IsPlayerAtRightHeightForType(forcedSpawn.skyEntityType, player))
         {
             this.SpawnForPlayer(player, forcedSpawn.skyEntityType);
         }
         this._forcedSpawns.RemoveAt(index);
     }
 }
예제 #2
0
 public void ForceEntitySpawn(AmbienceServer.AmbienceSpawnInfo info)
 {
     this._forcedSpawns.Add(info);
 }