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.Fi
The location of this mod's zip file/folder on the disk.arc.graphics.Texture
Icon texture.Class loader for JAR mods.final Mod
The mod's main class; may be null.final Mods.ModMeta
This 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 String
Internal mod name.final arc.files.Fi
The 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 TypeMethodDescriptionvoid
addSteamID
(String id) adds a steam ID to this item once it's published.arc.files.Fi
arc.files.Fi
void
dispose()
boolean
enabled()
int
getRepo()
boolean
boolean
boolean
Some mods are known to cause issues with the game; this detects and returns whether a mod is manually blacklisted.boolean
isJava()
boolean
boolean
boolean
called before this item is published.void
removes the item ID; called when the item isn't found.void
boolean
steamTag()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface arc.util.Disposable
isDisposed
Methods 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:
dispose
in interfacearc.util.Disposable
-
getSteamID
- Specified by:
getSteamID
in interfacePublishable
- Returns:
- workshop item ID, or null if this isn't on the workshop.
-
addSteamID
Description copied from interface:Publishable
adds a steam ID to this item once it's published. should save the item to make sure this change is persisted.- Specified by:
addSteamID
in interfacePublishable
-
removeSteamID
public void removeSteamID()Description copied from interface:Publishable
removes the item ID; called when the item isn't found.- Specified by:
removeSteamID
in interfacePublishable
-
steamTitle
- Specified by:
steamTitle
in interfacePublishable
- Returns:
- default title of the listing.
-
steamDescription
- Specified by:
steamDescription
in interfacePublishable
- Returns:
- standard steam listing description, may be null. this is editable by users after release.
-
steamTag
- Specified by:
steamTag
in interfacePublishable
- Returns:
- the tag that this content has. e.g. 'schematic' or 'map'.
-
createSteamFolder
- Specified by:
createSteamFolder
in interfacePublishable
- Returns:
- a folder with everything needed for this piece of content in it; does not need to be a copy.
-
createSteamPreview
- Specified by:
createSteamPreview
in interfacePublishable
- Returns:
- a preview file PNG.
-
prePublish
public boolean prePublish()Description copied from interface:Publishable
called before this item is published.- Specified by:
prePublish
in 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
-