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.booleanIf true, this content is invalid (added in a data patch and then removed). -
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()booleanbooleanvoidload()Called after all content is created, only on non-headless versions.voidloadIcon()Called right before load().voidpostInit()Called after init().voidCalled when this content is removed in a data patch.toString()
-
Field Details
-
id
public short id -
minfo
Info on which mod this content was loaded from. -
removed
public boolean removedIf true, this content is invalid (added in a data patch and then removed).
-
-
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. -
removeContent
public void removeContent()Called when this content is removed in a data patch. -
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.
-
isPatchContent
public boolean isPatchContent()- Returns:
- whether this content is from a map data patch.
-
compareTo
- Specified by:
compareToin interfaceComparable<Content>
-
toString
-