Class CoreLifecyclePluginImpl

java.lang.Object
com.fs.starfarer.api.BaseModPlugin
com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl
All Implemented Interfaces:
ModPlugin

public class CoreLifecyclePluginImpl extends BaseModPlugin
  • Field Details

  • Constructor Details

    • CoreLifecyclePluginImpl

      public CoreLifecyclePluginImpl()
  • Method Details

    • onGameLoad

      public void onGameLoad(boolean newGame)
      Description copied from interface: ModPlugin
      Called after a game has been loaded. Also called when a new game is created, after the onNewGame() plugins for all the mods have been called.
      Specified by:
      onGameLoad in interface ModPlugin
      Overrides:
      onGameLoad in class BaseModPlugin
    • addMissingPeople

      public static void addMissingPeople()
    • verifyFactionData

      public static void verifyFactionData()
    • verifyFactionData

      public static void verifyFactionData(FactionAPI faction)
    • addScriptsIfNeeded

      protected void addScriptsIfNeeded()
    • addBarEvents

      protected void addBarEvents()
    • onNewGame

      public void onNewGame()
      Description copied from interface: ModPlugin
      Called when a new game is being created. This is the preferred way to generate the contents of the Sector, and is meant to replace generators.csv (which remains used for backwards compatibility).
      Specified by:
      onNewGame in interface ModPlugin
      Overrides:
      onNewGame in class BaseModPlugin
    • onNewGameAfterTimePass

      public void onNewGameAfterTimePass()
      Description copied from interface: ModPlugin
      After the new game has stepped through its initial 2 months.
      Specified by:
      onNewGameAfterTimePass in interface ModPlugin
      Overrides:
      onNewGameAfterTimePass in class BaseModPlugin
    • onNewGameAfterEconomyLoad

      public void onNewGameAfterEconomyLoad()
      Description copied from interface: ModPlugin
      Called after the economy is loaded from economy.json and the initial steps are taken. At this point, calling get getMarket() on entities will return the proper market. The sequence of calls is: onNewGame(); // can add markets to the economy here programmatically //load economy and step it onNewGameAfterEconomyLoad();
      Specified by:
      onNewGameAfterEconomyLoad in interface ModPlugin
      Overrides:
      onNewGameAfterEconomyLoad in class BaseModPlugin
    • markStoryCriticalMarketsEtc

      public void markStoryCriticalMarketsEtc()
    • tagLuddicShrines

      public void tagLuddicShrines()
    • updateKnownPlanets

      protected void updateKnownPlanets()
    • addJunk

      public static void addJunk(MarketAPI market)
    • addRuinsJunk

      public static void addRuinsJunk(SectorEntityToken planet)
    • addJunk

      protected void addJunk()
    • regenAsteroids

      protected void regenAsteroids()
    • beforeGameSave

      public void beforeGameSave()
      Description copied from interface: ModPlugin
      Called before a game is saved.
      Specified by:
      beforeGameSave in interface ModPlugin
      Overrides:
      beforeGameSave in class BaseModPlugin
    • econPreSaveCleanup

      protected void econPreSaveCleanup()
    • econPostSaveRestore

      public static void econPostSaveRestore()
    • afterGameSave

      public void afterGameSave()
      Description copied from interface: ModPlugin
      Called after a game is saved.
      Specified by:
      afterGameSave in interface ModPlugin
      Overrides:
      afterGameSave in class BaseModPlugin
    • onGameSaveFailed

      public void onGameSaveFailed()
      Description copied from interface: ModPlugin
      Called if saving the game failed for some reason, such as running out of memory.
      Specified by:
      onGameSaveFailed in interface ModPlugin
      Overrides:
      onGameSaveFailed in class BaseModPlugin
    • restoreRemovedEntities

      protected void restoreRemovedEntities()
    • createInitialPeople

      public static void createInitialPeople(MarketAPI market, Random random)
    • dedupePortraits

      public static void dedupePortraits(List<PersonAPI> people)
    • regenPortrait

      public static void regenPortrait(PersonAPI person)
    • getPortraitCount

      public static int getPortraitCount(List<PersonAPI> people, PersonAPI person)
    • hasDuplicatePortraits

      public static boolean hasDuplicatePortraits(List<PersonAPI> people)
    • assignCustomAdmins

      protected void assignCustomAdmins()
    • addSkillsAndAssignAdmin

      public static void addSkillsAndAssignAdmin(MarketAPI market, PersonAPI admin)
    • configureXStream

      public void configureXStream(com.thoughtworks.xstream.XStream x)
      Specified by:
      configureXStream in interface ModPlugin
      Overrides:
      configureXStream in class BaseModPlugin
    • pickShipAI

      public PluginPick<ShipAIPlugin> pickShipAI(FleetMemberAPI member, ShipAPI ship)
      Description copied from interface: ModPlugin
      Called to pick an AI implementation for a specific ship. Here instead of in CampaignPlugin to support custom AI for missions.
      Specified by:
      pickShipAI in interface ModPlugin
      Overrides:
      pickShipAI in class BaseModPlugin
      Parameters:
      member - Can be null.
      ship - Can not be null. Could be a ship or a fighter.
      Returns:
      null, or a custom AI implementation.
    • convertTo0951aSkillSystemIfNeeded

      public void convertTo0951aSkillSystemIfNeeded()
    • convertPersonSkillsTo0951a

      public void convertPersonSkillsTo0951a(PersonAPI person)
    • removeSkill

      public void removeSkill(String id, PersonAPI person)
    • convertSkill

      public void convertSkill(String from, String to, PersonAPI person)