Class Plugin
- All Implemented Interfaces:
Comparable<Plugin>
A Plugin is a mod for MCreator allowing to alter, improve or extend features. Most of elements inside MCreator are plugin driven.
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
getFile()
getID()
The ID is the plugin's registry name.getInfo()
It returns aPluginInfo
object containing additional and optional info about the plugin.int
The weight of a plugin is its priority to be loaded.int
hashCode()
boolean
MCreator detects if a plugin is included or not.boolean
The plugin is compatible when the version of MCreator used is included in the supported versions list.boolean
boolean
isLoaded()
A plugin is loaded when all plugin dependencies are present and plugin loaded without errors.toString()
toURL()
-
Method Details
-
getFile
-
isBuiltin
public boolean isBuiltin()MCreator detects if a plugin is included or not. This method is mainly used with plugins in preferences.- Returns:
The plugin is builtin, so included with MCreator.
-
isLoaded
public boolean isLoaded()A plugin is loaded when all plugin dependencies are present and plugin loaded without errors.- Returns:
The plugin is loaded.
-
getID
The ID is the plugin's registry name. It is used to differentiate each plugin in the code. A plugin defines its own ID.- Returns:
The plugin's ID
-
getInfo
It returns aPluginInfo
object containing additional and optional info about the plugin. This object is only used inside the plugin panel.- Returns:
Other info about the plugin
-
getWeight
public int getWeight()The weight of a plugin is its priority to be loaded. Higher this value is, higher its priority is. This also determines how MCreator loads plugins. After MCreator has detected all plugins, it will check for their weight and then, load plugins with the highest value first. It can be used to override another plugin, but the value should never be higher than 10 as this is the value or core plugins.
- Returns:
The weight of the plugin
-
isCompatible
public boolean isCompatible()The plugin is compatible when the version of MCreator used is included in the supported versions list.
When the supported versions list is null, the plugin is compatible with all versions of MCreator.
When the supported versions list contains the short version of MCreator, the plugin is compatible with that MCreator release.
- Returns:
If the plugin is compatible with the version used.
-
getSupportedVersions
- Returns:
The list of supported versions
-
getPluginVersion
- Returns:
The MCreator's version when builtin and the plugin's version in the other case
-
toURL
- Throws:
MalformedURLException
-
getLoadFailure
-
isJavaPlugin
public boolean isJavaPlugin() -
getJavaPlugin
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Plugin>
-