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