Class Plugin

java.lang.Object
net.mcreator.plugin.Plugin
All Implemented Interfaces:
Comparable<Plugin>

public class Plugin extends Object implements 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 Details

    • getFile

      public File 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

      public String 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

      public PluginInfo getInfo()
      It returns a PluginInfo 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

      @Nullable public List<Long> getSupportedVersions()
      Returns:

      The list of supported versions

    • getPluginVersion

      public String getPluginVersion()
      Returns:

      The MCreator's version when builtin and the plugin's version in the other case

    • toURL

      public URL toURL() throws MalformedURLException
      Throws:
      MalformedURLException
    • getLoadFailure

      @Nullable public String getLoadFailure()
    • isJavaPlugin

      public boolean isJavaPlugin()
    • getJavaPlugin

      @Nullable public String getJavaPlugin()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object element)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(@Nonnull Plugin p)
      Specified by:
      compareTo in interface Comparable<Plugin>