public WorldWeatherCommand() { WeatherActors.Add(WeatherType.Sunny, SetSunny); WeatherActors.Add(WeatherType.LightRain, SetLightRain); WeatherActors.Add(WeatherType.Rain, SetRain); WeatherActors.Add(WeatherType.HeavyRain, SetHeavyRain); WeatherActors.Add(WeatherType.Storm, SetStorm); WeatherActors.Add(WeatherType.SlimeRain, SetSlimeRain); }
public void SetWeatherType(WeatherType type) { if (WeatherActors.TryGetValue(type, out var act)) { act(); Terraria.NetMessage.SendData(7); var col = Server.Instance.Colors; Sender.SendFormattedMessage($"The world weather has been updated to {col.TargetEmphasis}{type}{col.Info}.", col.Info); Server.Instance.Commands.LogCommandActivity(Sender, $"Changed world weather to {type}"); } }