Package mindustry.ctype
Class Content
java.lang.Object
mindustry.ctype.Content
- All Implemented Interfaces:
Comparable<Content>
- Direct Known Subclasses:
BulletType
,ErrorContent
,MappableContent
Base class for a content type that is loaded in
ContentLoader
.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionshort
Info on which mod this content was loaded from. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
abstract ContentType
Returns the type name of this piece of content.boolean
void
init()
Called after all content and modules are created.boolean
isModded()
boolean
void
load()
Called after all content is created, only on non-headless versions.void
loadIcon()
Called right before load().toString()
-
Field Details
-
id
public short id -
minfo
Info on which mod this content was loaded from.
-
-
Constructor Details
-
Content
public Content()
-
-
Method Details
-
getContentType
Returns the type name of this piece of content. This should return the same value for all instances of this content type. -
init
public void init()Called after all content and modules are created. Do not use to load regions or texture data! -
load
public void load()Called after all content is created, only on non-headless versions. Use for loading regions or other image data. -
loadIcon
public void loadIcon()Called right before load(). -
hasErrored
public boolean hasErrored()- Returns:
- whether an error occurred during mod loading.
-
isVanilla
public boolean isVanilla()- Returns:
- whether this is content from the base game.
-
isModded
public boolean isModded()- Returns:
- whether this content is from a mod.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Content>
-
toString
-