Class ContentLoader

java.lang.Object
mindustry.core.ContentLoader

public class ContentLoader extends Object
Loads all game content. Call load() before doing anything with content.
  • Constructor Details

    • ContentLoader

      public ContentLoader()
  • Method Details

    • createBaseContent

      public void createBaseContent()
      Creates all base types.
    • createModContent

      public void createModContent()
      Creates mod content, if applicable.
    • logContent

      public void logContent()
      Logs content statistics.
    • init

      public void init()
      Calls Content#init() on everything. Use only after all modules have been created.
    • load

      public void load()
      Calls Content#loadIcon() and Content#load() on everything. Use only after all modules have been created on the client.
    • loadColors

      public void loadColors()
      Loads block colors.
    • getLastAdded

      @Nullable public Content getLastAdded()
      Get last piece of content created for error-handling purposes.
    • removeLast

      public void removeLast()
      Remove last content added in case of an exception.
    • handleContent

      public void handleContent(Content content)
    • setCurrentMod

      public void setCurrentMod(@Nullable Mods.LoadedMod mod)
    • transformName

      public String transformName(String name)
    • handleMappableContent

      public void handleMappableContent(MappableContent content)
    • setTemporaryMapper

      public void setTemporaryMapper(MappableContent[][] temporaryMapper)
    • byName

      @Nullable public MappableContent byName(String name)
      Returns:
      the last registered content with the specified name. Note that the content loader makes no attempt to resolve name conflicts. This method can be unreliable.
    • getContentMap

      public arc.struct.Seq<Content>[] getContentMap()
    • each

      public void each(arc.func.Cons<Content> cons)
    • getByName

      public <T extends MappableContent> T getByName(ContentType type, String name)
    • getByID

      public <T extends Content> T getByID(ContentType type, int id)
    • getBy

      public <T extends Content> arc.struct.Seq<T> getBy(ContentType type)
    • blocks

      public arc.struct.Seq<Block> blocks()
    • block

      public Block block(int id)
    • block

      public Block block(String name)
    • items

      public arc.struct.Seq<Item> items()
    • item

      public Item item(int id)
    • item

      public Item item(String name)
    • liquids

      public arc.struct.Seq<Liquid> liquids()
    • liquid

      public Liquid liquid(int id)
    • liquid

      public Liquid liquid(String name)
    • bullets

      public arc.struct.Seq<BulletType> bullets()
    • bullet

      public BulletType bullet(int id)
    • statusEffects

      public arc.struct.Seq<StatusEffect> statusEffects()
    • statusEffect

      public StatusEffect statusEffect(String name)
    • sectors

      public arc.struct.Seq<SectorPreset> sectors()
    • sector

      public SectorPreset sector(String name)
    • units

      public arc.struct.Seq<UnitType> units()
    • unit

      public UnitType unit(int id)
    • unit

      public UnitType unit(String name)
    • planets

      public arc.struct.Seq<Planet> planets()
    • planet

      public Planet planet(String name)
    • weathers

      public arc.struct.Seq<Weather> weathers()
    • weather

      public Weather weather(String name)
    • unitStances

      public arc.struct.Seq<UnitStance> unitStances()
    • unitStance

      public UnitStance unitStance(int id)
    • unitStance

      public UnitStance unitStance(String name)
    • unitCommands

      public arc.struct.Seq<UnitCommand> unitCommands()
    • unitCommand

      public UnitCommand unitCommand(int id)
    • unitCommand

      public UnitCommand unitCommand(String name)