Class DimensionsAddon

java.lang.Object
me.xxastaspastaxx.dimensions.addons.DimensionsAddon

public abstract class DimensionsAddon extends Object
The abstract class that is parent to all the addons that are being loaded by Dimensions
  • Constructor Details

    • DimensionsAddon

      public DimensionsAddon(String addonName, String addonVersion, String addonDescription, DimensionsAddonPriority addonPriority)
      Constructor of DimensionsAddon
      Parameters:
      addonName - The name of the addon
      addonVersion - The version of the addon
      addonDescription - A short description of the addon
      addonPriority - Priority to enable the addon
  • Method Details

    • getName

      public String getName()
      Get the name of the addon
      Returns:
      the name of the addon
    • getVersion

      public String getVersion()
      Get the version of the addon
      Returns:
      the version of the addon
    • getDescription

      public String getDescription()
      Get the description of the addon
      Returns:
      the description of the addon
    • getAddonPriority

      public DimensionsAddonPriority getAddonPriority()
      Get the priority of the addon
      Returns:
      the priority of the addon
    • setOption

      public static void setOption(CustomPortal portal, String key, Object value)
      Store an Object with a String key for all portals that are the given CustomPortal
      Parameters:
      portal - the CustomPortal that contains the option
      key - the key to store and access the value
      value - the value to be stored
    • setOption

      public static void setOption(CompletePortal complete, String key, Object value)
      Store an Object with a String key for this specific portal
      Parameters:
      complete - the portal that contains the option
      key - the key to store and access the value
      value - the value to be stored
    • getOption

      public static Object getOption(CompletePortal complete, String key)
      Get the option for the portal. If the portal does not contain the key, then we check the type of the portal for the given key
      Parameters:
      complete - the portal to get the option for
      key - the key to access the value
      Returns:
    • getOption

      public static Object getOption(CustomPortal portal, String key)
      Get the option for the type of the portal for the given key
      Parameters:
      CustomPortal - to get the option for
      key - the key to access the value
      Returns:
    • onLoad

      public boolean onLoad(Dimensions pl)
      Run when loading the addon
      Parameters:
      pl - the instance of the Dimensions plugin
      Returns:
      true if the addon was loaded without any missing dependencies
    • onEnable

      public void onEnable(Dimensions pl)
      Run when the addon is being enabled
      Parameters:
      pl - the instance of the Dimensions plugin
    • onDisable

      public void onDisable()
      Run when disabling the addon
    • registerPortal

      public void registerPortal(org.bukkit.configuration.file.YamlConfiguration portalConfig, CustomPortal portal)
      This function provides the portal config file for each portal that is being loaded and addons can get data from it.
      Parameters:
      portalConfig - the YamlConfiguration for the portal loading
      portal - the portal loading
    • resetOptions

      public static void resetOptions()
      This runs when we reload the plugin AFTER all the addons have been disabled in order to reset all the data