Package mindustry.core
Class ContentLoader
java.lang.Object
mindustry.core.ContentLoader
Loads all game content.
Call load() before doing anything with content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblock(int id) arc.struct.Seq<Block>blocks()bullet(int id) arc.struct.Seq<BulletType>bullets()voidCreates all base types.voidCreates mod content, if applicable.void<T extends Content>
arc.struct.Seq<T>getBy(ContentType type) <T extends Content>
TgetByID(ContentType type, int id) <T extends MappableContent>
TgetByName(ContentType type, String name) arc.struct.Seq<Content>[]Get last piece of content created for error-handling purposes.voidhandleContent(Content content) voidhandleMappableContent(MappableContent content) voidinit()Calls Content#init() on everything.item(int id) arc.struct.Seq<Item>items()liquid(int id) arc.struct.Seq<Liquid>liquids()voidload()Calls Content#loadIcon() and Content#load() on everything.voidLoads block colors.voidLogs content statistics.arc.struct.Seq<Planet>planets()voidRemove last content added in case of an exception.arc.struct.Seq<SectorPreset>sectors()voidvoidsetTemporaryMapper(MappableContent[][] temporaryMapper) statusEffect(String name) arc.struct.Seq<StatusEffect>transformName(String name) unit(int id) unitCommand(int id) unitCommand(String name) arc.struct.Seq<UnitCommand>arc.struct.Seq<UnitType>units()unitStance(int id) unitStance(String name) arc.struct.Seq<UnitStance>arc.struct.Seq<Weather>weathers()
-
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
Get last piece of content created for error-handling purposes. -
removeLast
public void removeLast()Remove last content added in case of an exception. -
handleContent
-
setCurrentMod
-
transformName
-
handleMappableContent
-
setTemporaryMapper
-
byName
- 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
-
each
-
getByName
-
getByID
-
getBy
-
blocks
-
block
-
block
-
items
-
item
-
item
-
liquids
-
liquid
-
liquid
-
bullets
-
bullet
-
statusEffects
-
statusEffect
-
sectors
-
sector
-
units
-
unit
-
unit
-
planets
-
planet
-
weathers
-
weather
-
unitStances
-
unitStance
-
unitStance
-
unitCommands
-
unitCommand
-
unitCommand
-