Package mindustry.mod
Class Mods.LoadedMod
java.lang.Object
mindustry.mod.Mods.LoadedMod
- All Implemented Interfaces:
arc.util.Disposable,Publishable
- Enclosing class:
- Mods
Represents a mod's state. May be a jar file, folder or zip.
-
Field Summary
FieldsModifier and TypeFieldDescriptionarc.struct.Seq<Mods.LoadedMod>This mod's dependencies as already-loaded mods.arc.struct.ObjectSet<Content>Content with initialization code.final arc.files.FiThe location of this mod's zip file/folder on the disk.arc.graphics.TextureIcon texture.Class loader for JAR mods.final ModThe mod's main class; may be null.final Mods.ModMetaThis mod's metadata.arc.struct.Seq<String>All missing required dependencies of this mod as strings.arc.struct.Seq<String>All missing soft dependencies of this mod as strings.final StringInternal mod name.final arc.files.FiThe root zip file; points to the contents of this mod.arc.struct.Seq<Mods.LoadedMod>This mod's soft dependencies as already-loaded mods.Current state of this mod. -
Constructor Summary
ConstructorsConstructorDescriptionLoadedMod(arc.files.Fi file, arc.files.Fi root, Mod main, ClassLoader loader, Mods.ModMeta meta) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSteamID(String id) adds a steam ID to this item once it's published.arc.files.Fiarc.files.Fivoiddispose()booleanenabled()intgetRepo()booleanbooleanbooleanSome mods are known to cause issues with the game; this detects and returns whether a mod is manually blacklisted.booleanisJava()booleanbooleanbooleancalled before this item is published.voidremoves the item ID; called when the item isn't found.voidbooleansteamTag()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface arc.util.Disposable
isDisposedMethods inherited from interface mindustry.type.Publishable
extraTags, hasSteamID
-
Field Details
-
file
public final arc.files.Fi fileThe location of this mod's zip file/folder on the disk. -
root
public final arc.files.Fi rootThe root zip file; points to the contents of this mod. In the case of folders, this is the same as the mod's file. -
main
The mod's main class; may be null. -
name
Internal mod name. Used for textures. -
meta
This mod's metadata. -
dependencies
This mod's dependencies as already-loaded mods. -
softDependencies
This mod's soft dependencies as already-loaded mods. -
missingDependencies
All missing required dependencies of this mod as strings. -
missingSoftDependencies
All missing soft dependencies of this mod as strings. -
erroredContent
Content with initialization code. -
state
Current state of this mod. -
iconTexture
@Nullable public arc.graphics.Texture iconTextureIcon texture. Should be disposed. -
loader
Class loader for JAR mods. Null if the mod isn't loaded or this isn't a jar mod.
-
-
Constructor Details
-
LoadedMod
public LoadedMod(arc.files.Fi file, arc.files.Fi root, Mod main, ClassLoader loader, Mods.ModMeta meta)
-
-
Method Details
-
isJava
public boolean isJava()- Returns:
- whether this is a java class mod.
-
getRepo
-
setRepo
-
enabled
public boolean enabled() -
shouldBeEnabled
public boolean shouldBeEnabled() -
hasUnmetDependencies
public boolean hasUnmetDependencies() -
hasContentErrors
public boolean hasContentErrors() -
isSupported
public boolean isSupported()- Returns:
- whether this mod is supported by the game version
-
isBlacklisted
public boolean isBlacklisted()Some mods are known to cause issues with the game; this detects and returns whether a mod is manually blacklisted. -
isOutdated
public boolean isOutdated()- Returns:
- whether this mod is outdated, i.e. not compatible with v8.
-
getMinMajor
public int getMinMajor() -
dispose
public void dispose()- Specified by:
disposein interfacearc.util.Disposable
-
getSteamID
- Specified by:
getSteamIDin interfacePublishable- Returns:
- workshop item ID, or null if this isn't on the workshop.
-
addSteamID
Description copied from interface:Publishableadds a steam ID to this item once it's published. should save the item to make sure this change is persisted.- Specified by:
addSteamIDin interfacePublishable
-
removeSteamID
public void removeSteamID()Description copied from interface:Publishableremoves the item ID; called when the item isn't found.- Specified by:
removeSteamIDin interfacePublishable
-
steamTitle
- Specified by:
steamTitlein interfacePublishable- Returns:
- default title of the listing.
-
steamDescription
- Specified by:
steamDescriptionin interfacePublishable- Returns:
- standard steam listing description, may be null. this is editable by users after release.
-
steamTag
- Specified by:
steamTagin interfacePublishable- Returns:
- the tag that this content has. e.g. 'schematic' or 'map'.
-
createSteamFolder
- Specified by:
createSteamFolderin interfacePublishable- Returns:
- a folder with everything needed for this piece of content in it; does not need to be a copy.
-
createSteamPreview
- Specified by:
createSteamPreviewin interfacePublishable- Returns:
- a preview file PNG.
-
prePublish
public boolean prePublish()Description copied from interface:Publishablecalled before this item is published.- Specified by:
prePublishin interfacePublishable- Returns:
- true to signify that everything is cool and good, or false to significy that the user has done something wrong. if false is returned, make sure to show a dialog explaining the error.
-
toString
-