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)
    • getContentMap

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

      public void each(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> Seq<T> getBy(ContentType type)
    • blocks

      public Seq<Block> blocks()
    • block

      public Block block(int id)
    • block

      public Block block(String name)
    • items

      public Seq<Item> items()
    • item

      public Item item(int id)
    • item

      public Item item(String name)
    • liquids

      public Seq<Liquid> liquids()
    • liquid

      public Liquid liquid(int id)
    • liquid

      public Liquid liquid(String name)
    • bullets

      public Seq<BulletType> bullets()
    • bullet

      public BulletType bullet(int id)
    • statusEffects

      public Seq<StatusEffect> statusEffects()
    • statusEffect

      public StatusEffect statusEffect(String name)
    • sectors

      public Seq<SectorPreset> sectors()
    • sector

      public SectorPreset sector(String name)
    • units

      public Seq<UnitType> units()
    • unit

      public UnitType unit(int id)
    • unit

      public UnitType unit(String name)
    • planets

      public Seq<Planet> planets()
    • planet

      public Planet planet(String name)