public void AddUpdatesForMcTemp() { var gameUpdates = GameUpdate.GetUpdates(_minecraftCronConfiguration.GameId).Cast <GameUpdate>().ToList(); var paperUpdates = PaperManifest.GetManifest(); foreach (var version in paperUpdates.Versions.Take(_minecraftCronConfiguration.PaperSettings.GetLastReleaseUpdates)) { var gameUpdate = PaperManifest.GetGameUpdate(version); if (!gameUpdates.Any(x => x.Name == gameUpdate.Name && x.GroupName == gameUpdate.GroupName)) { gameUpdate.Save(); LogManager.Write($"[Minecraft Paper Update Cron] Saved Game Update for {version}", LogType.Console); } else { LogManager.Write("[Minecraft Paper Update Cron] Game Update already exists for " + version, LogType.Console); } } }
public void AddUpdatesForMcTemp() { var gameUpdates = GameUpdate.GetUpdates(_paperSettings.GameId).Cast <GameUpdate>().ToList(); var paperUpdates = PaperManifest.GetManifest(); paperUpdates.Versions = paperUpdates.Versions.Reverse().ToList(); foreach (var version in paperUpdates.Versions.Take(_paperSettings.GetLastReleaseUpdates)) { var gameUpdate = PaperManifest.GetGameUpdate(version); if (!gameUpdates.Any(x => x.Name == gameUpdate.Name && x.GroupName == gameUpdate.GroupName)) { gameUpdate.Save(); Logger.Information($"Saved Game Update for {version}"); } else { Logger.Information("Game Update already exists for " + version); } } }