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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionshortInfo on which mod this content was loaded from. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after being patched.intabstract ContentTypeReturns the type name of this piece of content.booleanvoidinit()Called after all content and modules are created.booleanisModded()booleanvoidload()Called after all content is created, only on non-headless versions.voidloadIcon()Called right before load().voidpostInit()Called after init().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! -
postInit
public void postInit()Called after init(). -
afterPatch
public void afterPatch()Called after being patched. -
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:
compareToin interfaceComparable<Content>
-
toString
-