Package mindustry.mod
Class Mods.LoadedMod
java.lang.Object
mindustry.mod.Mods.LoadedMod
- All Implemented Interfaces:
Disposable
,Publishable
- Enclosing class:
- Mods
Represents a mod's state. May be a jar file, folder or zip.
-
Field Summary
Modifier and TypeFieldDescriptionThis mod's dependencies as already-loaded mods.Content with initialization code.final Fi
The location of this mod's zip file/folder on the disk.Icon texture.Class loader for JAR mods.final Mod
The mod's main class; may be null.final Mods.ModMeta
This mod's metadata.All missing dependencies of this mod as strings.final String
Internal mod name.final Fi
The root zip file; points to the contents of this mod.Current state of this mod. -
Constructor Summary
ConstructorDescriptionLoadedMod
(Fi file, 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.void
dispose()
Releases all resources of this object.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
The location of this mod's zip file/folder on the disk. -
root
The 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. -
missingDependencies
All missing dependencies of this mod as strings. -
erroredContent
Content with initialization code. -
state
Current state of this mod. -
iconTexture
Icon 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
-
-
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, e.g. not compatible with v7.
-
getMinMajor
public int getMinMajor() -
dispose
public void dispose()Description copied from interface:Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
-
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
-