public override void Handle() { if (!PluginSettings.Instance.AtmosphericCargoShipsEnabled) { return; } CargoShips.SpawnCargoShip(false); }
public override bool HandleCommand(ulong userId, string[] words) { if (words.Length == 1 && words[0].ToLower( ) == "atmosphere") { CargoShips.SpawnCargoShip(false); return(true); } var cargoShipEvent = MyGlobalEvents.GetEventById(new MyDefinitionId(typeof(MyObjectBuilder_GlobalEventBase), "SpawnCargoShip")); if (cargoShipEvent == null) { //we can't force the game to spawn a ship if the option is off, so use our own method CargoShips.SpawnCargoShip(true); } else { MyGlobalEvents.RemoveGlobalEvent(cargoShipEvent); cargoShipEvent.SetActivationTime(TimeSpan.Zero); MyGlobalEvents.AddGlobalEvent(cargoShipEvent); } return(true); }